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

Claus Ibsen commented on CAMEL-18950:
-------------------------------------

This works now. camel-openapi-java builds the model schemas directly with 
swagger-core's `ModelConverters`
(`DefaultRestModelConverters`) and no longer copies them into another model. So 
`maxLength`, `minLength` and
`defaultValue` from `@Schema` show up in the generated document: a field 
annotated as in the description gives
`"maxLength": 20, "minLength": 1, "default": "Default message"` for OpenAPI 3.0 
and 3.1. Closing; please reopen with a
reproducer if you still miss a property.

_Claude Code on behalf of davsclaus_

> camel-openapi-java - Add support for missing @Schema-annotation properties
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-18950
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18950
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-openapi-java
>    Affects Versions: 3.19.0
>         Environment: Maven dependencies:
>  * camel-openapi-java: 3.19.0
>  * swagger-core: 2.1.13
>            Reporter: Sami Peltola
>            Priority: Minor
>
> Related to issue CAMEL-16986
> When using the @Schema annotation for OpenAPI documentation, still some of 
> the properties of the annotation are ignored, mainly "maxLength", "minLength" 
> and "defaultValue". These values missing from the  generated JSON file.
> Related Open API definition: 
> https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#schema-object
>  
> Example:
>  
> {code:java}
>     @Schema(required = true, description = "Message description", example = 
> "Example message", defaultValue = "Default message", maxLength = 20, 
> minLength = 1)
>     private String message;
> {code}
>  
> Currently generated JSON:
> {code:json}
>   "components" : {
>     "schemas" : {
>       "InputModel" : {
>         "required" : [ "message" ],
>         "type" : "object",
>         "properties" : {
>           "message" : {
>             "description" : "Message description",
>             "type" : "string",
>             "example" : "Example message"
>           },
> {code}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to