-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Recursive Child elements do not generate correctly for OpenAPI #3049
Comments
Hi, thanks for your issue. I'm confused, aren't the two examples you show here identical? Why do you expect there to be a |
Hi @johanbrandhorst, I think you're talking about the Please see here for the requirement inside an maybe, it is required for non-recursive references too. But the validator I'm using (the one inside https://github.com/opticdev/optic) seems to think it's fine. |
I did look at that definition, and it does state that |
@johanbrandhorst then it would be an inconsistency in the validator Nonetheless it is still valid that the |
I agree with that interpretation of the spec, I'm just surprised that their examples are... invalid code? In any case, it probably shouldn't hurt for us to add this. Would you be interested in contributing a fix? |
🐛 Bug Report
Recursive child members do not render properly in OpenAPI
To Reproduce
For a given proto, generate the openapiv2 output (I used buf):
Expected behavior
Actual Behavior
However, on the other hand, if your repeated section is NOT a recursive one, e.g. for the below proto:
the generated openAPI spec looks like:
Which is totally valid.
I've tried both cases and it seems like even adding a
type
to the second example will work, so it looks like it can be added across the board for children.Your Environment
Alpine 3.15, but reproducible everywhere
The text was updated successfully, but these errors were encountered: