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

Rest builder does not honor openAPI XML Object wrapped field.

    Details

      Description

      Reproduction steps:

      1. Add an array definition to the rest-openapi.yaml without setting "wrapped:" "true"
        for example:
          
                TestObject:
                  type: object
                  properties:
                    arrayObjects:
                      type: array
                      wrapped: false
                      items:
                        $ref: '#/components/schemas/ArrayObject'
                ArrayObject:
                  type: object
                  properties:
                    title:
                      type: string
      2. Try to invoke an endpoint using xml without the wrapped field
        curl --location --request POST 'http://localhost:8080/o/mymodule/v1.0/myendpoint' \
        -u '[email protected]:test' \
        --header 'Content-Type: application/xml' \
        --data-raw '<?xml version="1.0" encoding="UTF-8"?>
        <TestObject>
        <arrayObjects>
        <title>string</title>
        </arrayObjects>
        </TestObject>'

      Actual behavior: calling the endpoint fails with the following error:

      "status" : "BAD_REQUEST",
      "title" : "Unable to map JSON path: arrayObjects.null"

      Expected behavior: you should be able to invoke the endpoint the mentioned way

        Attachments

          Activity

            People

            Assignee:
            brian.chan Brian Chan
            Reporter:
            zalan.szakolci Zalán Szakolci
            Participants of an Issue:
            Recent user:
            Javier de Arcos Velilla
            Engineering Assignee:
            Javier Gamarra
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 weeks, 5 days ago

                Packages

                Version Package
                Master