Skip to content

Regression in array type generation #3301

Description

@caoimhebyrne

Describe the bug

In springdoc-openapi v3.0.3, we noticed a change in behavior from 3.0.1. An object with a self-referential array property would previously be generated with the correct ref, but now, it gets generated with a type of object.

Before:

"Foo": {
  "properties": {
    "foo" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/components/schemas/Foo"
      }
    }
  }
}

After:

"Foo": {
  "properties": {
    "foo" : {
      "type" : "array",
      "items" : {
        "type": "object",
        "required": ["type"]
      }
    }
  }
}

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? 4.0.1
  • What modules and versions of springdoc-openapi are you using? springdoc-openapi-starter-webmvc-scalar:3.0.3
  • What is the actual and the expected result using OpenAPI Description (yml or json)? See above
  • Provide with a sample code (HelloController) or Test that reproduces the problem Unable to at the moment

Expected behavior

See above.

Screenshots
N/A

Additional context
I noticed this PR: #3259 which affects generic types, I have a feeling it might be related.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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