Skip to content

Descriptions from @ArraySchema has disappered after upgrading to 2.8.6 #2953

@seskildsen

Description

@seskildsen
  • A clear and concise description of what the bug is: the title of an issue is not enough

After upgrading from spring doc (springdoc-openapi-starter-webmvc-ui) from 2.7.0 to 2.8.6 descriptions from @ArraySchema has disappeared.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
    3.4.4

  • What modules and versions of springdoc-openapi are you using?

        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>2.8.6</version>
        </dependency>

DTO Class:

public class ClassName {

  @Schema(description = "A text here1.")
  private String fieldName1;

  @ArraySchema(arraySchema = @Schema(description = "A text here2."))
  private List<String> fieldName2 = new ArrayList<>();
...
}
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
    Actual result (api-docs):
...
  "components": {
    "schemas": {
          "ClassName": {
            "type": "object",
            "properties": {
              "fieldName1": {
                "type": "string",
                "description": "A text here1."
              },
              "fieldName2": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
...

Expected result:

...
  "components": {
    "schemas": {
          "ClassName": {
            "type": "object",
            "properties": {
              "fieldName1": {
                "type": "string",
                "description": "A text here1."
              },
              "fieldName2": {
                "type": "array",
                "description": "A text here2.",
                "items": {
                  "type": "string"
                }
              }
            }
          }
...

Expected behavior

I expect that the description from @ArraySchema appears in components schema.

What have I tried:
I have tried to change the @ArraySchema(arraySchema = @Schema(description = "A text here2.")) to @Schema(description = "A text here2.") but then the descriptions from @ArraySchema appears twice.

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