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

Visitors - no shortcut for recursive references causing stack overflow #656

Open
Wozbo opened this issue May 13, 2024 · 0 comments
Open

Comments

@Wozbo
Copy link

Wozbo commented May 13, 2024

Describe the issue
When visitors are traversing a model to generate schema, it looks like any form of recursion causes a stack overflow. This occurs when the recursion is across models.

A => A - handled.

A => B => A - not handled
A => B => {...} => A - not handled.

To Reproduce
Steps to reproduce the behavior:
Create a standard API with open api attributes.

Create a model of type A that has a property of Type B.
Create a model of type B that has a property of Type C.
Create a model of type C that has a property of Type A.

Adding one extra level of indirection, as that would handle both the broken cases brought up above.

Expected behavior
Recursion for a visitor should short circuit and substitute a reference.

As far as I can tell, this issue is split across OpenApiSchemaAcceptor, and possibly the TypeVisitor.

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