-
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
Generated OpenAPI document fails validation on parameters in path #2084
Comments
Some light digging and it seems that This is probably the right check, but maybe there should be a different outcome? Replacing This is my first time looking at the code so apologies if this sounds appalling, but what do you think about the following?
We sacrifice the parameter's intended format in exchange for being able to generate an OpenAPI file. |
Hi @someone1, thanks for the detailed issue! This area of the code is somewhat unfamiliar to me as well, so I would be happy to discuss changing it so that it works as expected in the generator. We'll want to be wary that whatever changes we make actually correspond to how it's being parsed by the gateway, but I think you suggestion makes sense. Then the question becomes whether our existing parser is clever enough to be able to make that translation, or if we need to rework it. Would you be interested in contributing a fix for this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'd like to contribute a fix if the draft I referenced is a few commits away from an acceptable solution. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
🐛 Bug Report
Take the example a little bit of everything swagger file and pop it into swagger editor/UI - it will fail validation checks
This feels like the issues raised in #720 and #1015 though I didn't want to bump an older issue or hijack another issue that seemed more specific.
Sometimes the path annotations generate fine in the OpenAPI document and other times not. For example, the following annotrations seem to work:
Generates:
However, the following does not:
Generates:
Interestingly, in the example above that doesn't' work, renaming
parent=
touser=
generates properly!Does the generator expect specific values in which it will trigger the correct generation in the OpenAPI spec for the path annotations? Switching from
parent
touser
to fix one such case of issues sounds buggy to me. I'm not certain how the second example/v1alpha/{name=users/*/accounts/*}
should map to query params in the OpenAPI spec, but the URL should probably look like/v1alpha/users/*/accounts/*
- I think the gateway itself processes all this okay, its just the generated OpenAPI spec that's falling short.Generated w/ v2.3.0
The text was updated successfully, but these errors were encountered: