You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Sami Peltola (Jira)" <ji...@apache.org> on 2023/01/18 12:58:00 UTC

[jira] [Created] (CAMEL-18950) camel-openapi-java - Add support for missing @Schema-annotation properties

Sami Peltola created CAMEL-18950:
------------------------------------

             Summary: 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


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
(v8.20.10#820010)