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

Support examples from the OpenAPI Spec #492

Open
vengroff opened this issue Jan 5, 2025 · 2 comments
Open

Support examples from the OpenAPI Spec #492

vengroff opened this issue Jan 5, 2025 · 2 comments
Labels
feature New feature or request

Comments

@vengroff
Copy link

vengroff commented Jan 5, 2025

This is a feature request originally posted in #57 (comment).

I have an OpenAPI spec that has a post endpoint with an examples section contained within the content section of the requestBody. When I look at the doc generated from this with the default zudoku.config.ts there is a box on the right where I can see sample calls in curl or a variety of languages. But all of them just pass empty lists or dictionaries to the various components of the request. All fields empty is not a valid input for this API, so it is frustrating to users that they don't see a working example.

What I would like to do is have a drop-down listing each of the examples the API spec provides with text for each choice coming from the summary field of one of the examples. When I pick one I would like to have it fill in the values in the example code from the value component of the chosen example and also render the description from the description field so the user can read it. This gives the user a known working input that they can then copy and paste or modify as they see fit. The standard docs generated by FastAPI do this for the API spec in question.

Copy link

linear bot commented Jan 5, 2025

@vengroff
Copy link
Author

vengroff commented Jan 6, 2025

Looking forward to this. Is there a way to get some additional visibility on priority and timing? I'm guessing that's what the linear bot link above is about, but it isn't visible to me.

@ntotten ntotten added the feature New feature or request label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

No branches or pull requests

2 participants