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

Resolve infinite recursion and add example test with OpenAPI v3.1 #2833

Merged

Conversation

martinitus
Copy link
Contributor

@martinitus martinitus commented Jan 2, 2025

Resolves #2801.

It turns out, that my desired workaround is no longer necessary, as one can now (since v3.1) have both a description and a $ref within a OpenAPI schema.

The PR still resolves the potential infinite recursion and gives the schema resolution a small refactor - makes it nicer to read - but thats obviously subjective.

Anyway, I think the testcase can serve as a hint to other users that had similar problems, and it shows that the workaround documented here may no longer be necessary when using OpenAPI v3.1.

As a side note: It also demonstrates, that swagger-api/swagger-core#3900 may potentially be resolved already!

@omarfi
Copy link

omarfi commented Jan 2, 2025

@martinitus Any ETA on this one? Ref my comment on #2801

@martinitus
Copy link
Contributor Author

Really depends on the maintainers here - seems like everyone is using the quite time we have right now to get some OSS work done :D.

I think I can add the self-referential scenario you mentioned to the tests, but my understanding of the code is still quite limited, so I'm not sure I'll be able to fix it.

@bnasslahsen bnasslahsen merged commit e1fff95 into springdoc:main Jan 2, 2025
@bnasslahsen
Copy link
Contributor

@martinitus,

I have added a simpler fix, where your expected test cases are still passing.
Please do not hesitate, to test it on your end.

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

Successfully merging this pull request may close these issues.

Stack Overflow / infinite recursion in PolymorphicModelConverter.findComposedSchemas
3 participants