Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-155081

Headless APIs missed value information when fails.

Description

    Due to the LPS-152965, value information given by the REST APIs was lost.

    Steps to reproduce

    • Create a blog with a POST request. For example:

     

    {
      "articleBody": "2",
      "creator": {
        "familyName": "Test",
        "givenName": "Test",
        "id": 20129,
        "name": "Test Test",
        "profileURL": "/web/test"
      },
      "dateCreated": "2019-04-10T23:02:50Z",
      "dateModified": "2019-04-11T14:39:05Z",
      "datePublished": "2019-04-11T14:39:00Z",
      "encodingFormat": "text/html",
      "friendlyUrlPath": "12",
      "headline": "3",
      "id": 63706,
      "numberOfComments": 0,
      "siteId": 20123
    }
    
    • Send the POST request again

    Expected result

     

    The API response with a CONFLICT message and additional information to guide the developer to diagnose why it is failing.

    {
      "status": "CONFLICT",
      "title": "Duplicate friendly URL"
    }
    

    Actual result

     

    The API response just with CONFLICT

    {
      "status": "CONFLICT"
    }
    

    Note that this is happening for all responses that are not 2XX under the headless APIs.

    This makes the development harder as it increases the difficulty to diagnose why is the request failing.

    This could break contracts with clients that are using the response to do some tasks, like showing a warning pop-up with the message.

     

    Attachments

      Activity

        People

          matija.petanjek Matija Petanjek
          luismiguel.barco Luis Miguel Barcos
          Felipe Lins Felipe Lins
          Matija Petanjek Matija Petanjek
          Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

            Created:
            Updated:
            17 weeks, 1 day ago

            Packages

              Version Package