Skip to content

Detail for schema of array object #2867

Description

@fforfabio

When I go under the schema tab inside the endpoint, if the object of the response or the request body is an array, the openapi show array <object> as root and Items as object of the array instead of the actual schema

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? 3.4.1
  • What modules and versions of springdoc-openapi are you using? springdoc-openapi-starter-webmvc-ui version 2.8.3

Expected behavior
My expectation is that when I change the tab from Example value to Schema if the object is an array, the schema must show that it is an array of a specific object.

If the object is not an array but a single one, there is no problem.

Until SpringBoot 3.3.5 this problem is not present (see the last screenshot)

Screenshots
As below the example correctly report that the returned object for a 400 Bad Request is an array, with possible multiple object with schema ApiError

Image

When change to the schema I don't see that the array is made of ApiError objects:

Image

Whit SpringBoot 3.3.5 everything is ok:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions