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

Liferay DXP's headless REST API is not working as expected

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 7.1.X, 7.2.X, 7.3.X, Master
    • Fix Version/s: None
    • Component/s: Headless Delivery API
    • Labels:

      Description

      Liferay provides the following document to leverage OpenAPI
      Get Started: Discover the API

      As per the document, we can get Liferay DXP's headless APIs from SwaggerHub
      https://app.swaggerhub.com/apis/liferayinc/headless-delivery/v1.0

      Issue1:

      Steps to reproduce:

      1) Start the Liferay DXP 7.1 server with fix pack dxp-16 and create one site(Headless) and create one page(Home) into it
      2) Navigate to that page and create basic web content(Contentone) with an expiry date and save it. Then note the content id
      3) Add the Advanced Rest Client(ARC) extension in your browser and open it
      4) As per the DXP's headless API pass the following URL with the GET method in ARC

      http://ipadress:port/o/headless-delivery/v1.0/sites/

      {siteId}

      /structured-contents/by-key/{key}
      In my case: http://localhost:8080/o/headless-delivery/v1.0/sites/33932/structured-contents/by-key/33949

      replace {siteId} with site id
      replace {key} with web content id

      5) When you send, you will get a JSON response.

      Expected behavior: Display, Expiry date should come
      Actual behavior: Display, Expiry date is not coming

      Issue 2:

      Steps to reproduce:

      1) Create a Structure with field "Web content"
      2) Create a Web content(Contenttwo) using that structure and embed another web content(Contentone) and then save and note the web content id.
      3) Follow the above step4 again with the respective article id

      Expected behavior: "key" should come in JSON response as it represents article id
      Actual behavior: There is no "key" instead "id" came and which is the value of id+2.

      Wanted to check is this expected or is there any alternate way/API to see the JSON response with the above-expected behavior.

      Note: Display and Expiry date are available through the JSON URL. Please check the attached screenshot(JSONWS_response.png).

      Reproduced on
      7.1.x - Commit: ce1ab4bf4664fed39a4f6cd8d514a9b0fe050bd9
      7.2.x - Commit: 02242460c21e8cc29a493282505ac59e043e6a82
      Master - Commit: 6a82184b83c93b770e7518d93bbd72d489f06908

      Please find the attached video(To_understand_the_issue.mkv) for complete reference. Let me know if anything is required from my end.

      Regards,
      Sivakumar

      * Please see Zendesk Support tab for further comments and attachments.

        Attachments

          Activity

            People

            Assignee:
            luismiguel.barco Luis Miguel Barcos
            Reporter:
            hong.vo Hong Vo
            Participants of an Issue:
            Recent user:
            Luis Miguel Barcos
            Engineering Assignee:
            Hong Vo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 11 weeks, 2 days ago

                Packages

                Version Package