Skip to content

Regression bug on circular object references #3015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
detomarco opened this issue Jun 3, 2025 · 0 comments
Open

Regression bug on circular object references #3015

detomarco opened this issue Jun 3, 2025 · 0 comments

Comments

@detomarco
Copy link

Describe the bug

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

Starting from 2.8.7 we noticed a regression bug related to circular object references.

Given these kotlin classes

data class Account(
    val id: String,
    val subs: List<Subscriptions>
)

data class Subscriptiong(
   val id: String.
) {

    var account: Account
}

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
    3.4.5
  • What modules and versions of springdoc-openapi are you using?
    springdoc-openapi-starter-webmvc-ui
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
## ACTUAL
{
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "subscriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Subscription"
            }
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "account": {
            "required": [ ## there should be a reference to Account here
              "id"
            ]
          }
        }
      }
  • Provide with a sample code (HelloController) or Test that reproduces the problem

Expected behavior

## EXPECTED (as in v2.8.6)

{

      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "subscriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Subscription"
            }
          }
        },
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          }
        },
      },

}
}
  • A clear and concise description of what you expected to happen.
  • What is the expected result using OpenAPI Description (yml or json)?

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant