[ 
https://issues.apache.org/jira/browse/CAMEL-21076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873120#comment-17873120
 ] 

Iliya Grushevskiy commented on CAMEL-21076:
-------------------------------------------

The commit is already in the branch 
[https://github.com/iliya-gr/camel/tree/CAMEL-21076]  I just can't login and 
make pull request.

Here is the patch 
[^CAMEL-21076_Fix_REST_route_definition_and_OpenAPI_schema_generation_for_array_type_request.patch]

> 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)

Reply via email to