Skip to content
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

StackOverflowError with object having an array of itself #871

Open
mcruzdev opened this issue Feb 28, 2025 · 0 comments
Open

StackOverflowError with object having an array of itself #871

mcruzdev opened this issue Feb 28, 2025 · 0 comments
Assignees

Comments

@mcruzdev
Copy link

mcruzdev commented Feb 28, 2025

Actually when using this OAPI specification (on quarkus-openapi-generator-server side):

{
  "openapi": "3.0.3",
  "info": {
    "title": "Recursive Example API",
    "version": "1.0.0"
  },
  "paths": {
    "/example": {
      "get": {
        "summary": "Get Something",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Something"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Something": {
        "type": "object",
        "properties": {
          "someGroup": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Something"
                }
              ]
            }
          }
        }
      }
    }
  }
}

We are getting a StackOverflowException.

You can reproduce this one, using my branch https://github.com/mcruzdev/apicurio-codegen/tree/issue-stackoverflow and executing the test testConstraintParameters_allOfSelfRef from an IDE.

@EricWittmann EricWittmann self-assigned this Mar 7, 2025
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

2 participants