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

Headless api throws error 500 when adding web content with incorrect categories data

    Details

      Description

      Steps to reproduce:

      • Create a required Vocabulary 'test' in your site: Asset Type: Web Content Article, Asset Subtype: Basic Web Content.
      • Add a category for 'test'.
      • Add a new basic web content defining a category.
      • Get, using the headless api, the recently created web content. Using, for example, the following service:
      GET http://localhost:8080/o/headless-delivery/v1.0/structured-contents/68626
      • Add, using the headless api, a new web content defining in the body the same content data obtained from 4 (attached in get_result.json). Using, for example, the following service:
      POST http://localhost:8080/o/headless-delivery/v1.0/sites/SITE_ID/structured-contents/

      Expected result: Since the POST categoryIds data has an incorrect format, no categories are parsed and an empty array is passed to the JournalArticle service add method. When the cateogories validation is done the service throws a AssetCategoryException.AT_LEAST_ONE_CATEGORY exception because we configured it as required. 

      We expect an error code with this specific information as a result.

      Current result:

      A 500 error code (Internal Server Error) is thrown with no specific info:

      {
       "status": "INTERNAL_SERVER_ERROR"
      }

       

        Attachments

          Activity

            People

            Assignee:
            brian.chan Brian Chan
            Reporter:
            cristina.rodriguez Cristina Rodriguez
            Participants of an Issue:
            Recent user:
            Yunlin "Steven" Sun
            Engineering Assignee:
            Javier de Arcos Velilla
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              37 weeks ago

                Packages

                Version Package
                7.2.10 DXP FP10
                7.2.10.4 DXP SP4
                7.2.X
                7.3.10 DXP FP1
                7.3.10.1 DXP SP1
                7.3.6 CE GA7
                7.3.X
                Master