Iliya Grushevskiy created CAMEL-21076:
-----------------------------------------

             Summary: camel-openapi-java: Incorrect schema is generated for 
array type request 
                 Key: CAMEL-21076
                 URL: https://issues.apache.org/jira/browse/CAMEL-21076
             Project: Camel
          Issue Type: Bug
          Components: camel-openapi-java
    Affects Versions: 3.x, 4.x
            Reporter: Iliya Grushevskiy


When specifying an array of objects as a request type (in PUT/POST methods), 
the generated OpenAPI schema does not match the expected result.

For example:
{code:java}
.post()
  .type(User[].class)
  .to("bean:...."){code}
Will generate:
{code:java}
"requestBody" : {
  "description" : "",
  "content" : {
    "application/json" : {
      "schema" : {
        "type" : "string"
      }
    }
  },
  "required" : true
}, {code}
While expected schema should be:
{code:java}
"requestBody" : {
  "description" : "",
  "content" : {
    "application/json" : {
      "schema" : {
        "type" : "array",
        "items" : {
          "$ref" : "#/components/schemas/User"
        }
      }
    }
  },
  "required" : true
} {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to