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

camel-openapi-java - Add support for description and example in @Schema annotation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.11.2
    • 3.12.0
    • camel-openapi-java
    • None
    • Maven dependencies:

      • camel-openapi-java-starter:3.11.2
      • camel-openapi-java:3.11.2
      • swagger-core: 2.1.10
    • Unknown

    Description

      When using the @Schema annotation for OpenAPI documentation, the "description" and "example" parameters are apparently ignored because the generated JSON file does not contain any of these elements.

      E.g.:

      @io.swagger.v3.oas.annotations.media.Schema(description = "The transaction id", example = "id-123")
      String id;
      

      Current generated JSON:

      [...]
      "components" : {
        "schemas" : {
          "Example" : {
            "type" : "object",
            "properties" : {
              "id" : {
                "type" : "string"
              },
      [...]
      

      Expected generated JSON:

      [...]
      "components" : {
        "schemas" : {
          "Example" : {
            "type" : "object",
            "properties" : {
              "id" : {
                  "description" : "The transaction id",
                  "type" : "string",
                  "example" : "id-123"
                },
      [...]
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              niriak Thorsten Roemer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: