Skip to content

Array elements in Schema have duplicate descriptions #330

@Andrew3431

Description

@Andrew3431

When schema has an array element present, the description is duplicated and is shown twice in the UI.

      "Filter": {
        "required": [
          "itemIds",
          "itemNames"
        ],
        "type": "object",
        "properties": {
          "itemIds": {
            "uniqueItems": true,
            "type": "array",
            "description": "A list of items",
            "items": {
              "type": "string",
              "description": "A list of items"
            }
          },
          "itemNames": {
            "uniqueItems": true,
            "type": "array",
            "description": "A list of item names",
            "items": {
              "type": "string",
              "description": "A list of item names"
            }
          }
        },
        "description": "The list of filters to use"
      }

FilterModel.java

    public class Filter {

        @Schema(description = "A list of items", required = true)
        Set<String> itemIds = new HashSet<>();

        @Schema(description = "A list of item names", required = true)
        Set<String> itemNames = new HashSet<>();
    }

How to avoid giving a description for the variable as well as giving a description for array item ?
I just want one description to be present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions