-
Notifications
You must be signed in to change notification settings - Fork 17
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
OpenAPI: support generating variants from examples in response schemas #471
Comments
Hi @bogi158 , may this be related to #472 ? I mean, in your first example, I suppose that it generates responses without body, it just sends a status because it does not find any content, but in the other examples, as the responses contains content, it tries to use the The plugin currently only generates route variants from the Anyway, this is something that very would be very useful too, so it probably deserves to be added in next releases. Thanks for reporting it! Note: If you don't mind, I will rename the issue to "OpenAPI: support generating variants from examples in response schemas" |
Hello! Yes indeed I have example on the response properties but I do not have a full example in Thank you! |
I ran into this same problem today and I think this would be indeed a very useful and wanted feature. I added some extra functionality to the openapi plugin here locally, and it seems to be working for my case. If you are interested, I can open a PR so we can hopefully have this feature available on a future release. |
OK, I went ahead and created a PR. I'm just not sure what the target branch should be (currently: release), but let me know and I'll update the PR. |
Describe the bug
When an response is defined, if this response have a content, the route is not generated
To Reproduce
Define a simple OpenAPI spec and add some content in a response. Then try to generate the code. You can just try with the Petstore API example.
Expected behavior
Code should be generated normally with a route variant that has a response as required by the specs
Logs
No logs are shown
** Operating system, Node.js an npm versions, or browser version (please complete the following information):**
Additional context
This works:
This does not work:
Also this:
The text was updated successfully, but these errors were encountered: