Skip to content

Description for array schema is being ignored when generating OpenAPI 3.1 #4836

@jochenberger

Description

@jochenberger

I have the following Java code:

class Street {
        @ArraySchema(schema = @Schema(implementation = House.class, description = "A house in the street"),
                     arraySchema = @Schema(description = "The houses in the street"))
        public List<House> houses;
}

When generating OpenAPI 3.0, I get

Street:
type: object
properties:
  houses:
    type: array
    description: The houses in the street
    items:
      $ref: "#/components/schemas/House"

The item description is missing, but that's another issue (#3900).
However, when I generate OpenAPI 3.1, I get

Street:
type: object
properties:
  houses:
    type: array
    items:
      $ref: "#/components/schemas/House"
      description: A house in the street

Now, the item description is there, but the array description is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions