[ https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873122#comment-17873122 ]
Claus Ibsen commented on CAMEL-21076: ------------------------------------- There is also an outType can you take a look at that too, and if it also need some fixing > 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 > Priority: Major > Fix For: 4.8.0 > > Attachments: > CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch > > > 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)