Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18950

camel-openapi-java - Add support for missing @Schema-annotation properties

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.19.0
    • None
    • camel-openapi-java
    • None
    • Maven dependencies:

      • camel-openapi-java: 3.19.0
      • swagger-core: 2.1.13
    • Unknown

    Description

      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:
       

          @Schema(required = true, description = "Message description", example = "Example message", defaultValue = "Default message", maxLength = 20, minLength = 1)
          private String message;
      

       

      Currently generated JSON:

        "components" : {
          "schemas" : {
            "InputModel" : {
              "required" : [ "message" ],
              "type" : "object",
              "properties" : {
                "message" : {
                  "description" : "Message description",
                  "type" : "string",
                  "example" : "Example message"
                },
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            samipeltola Sami Peltola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: