Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Use a default values for a request Swagger UI documentation #5

Closed
zero0nee opened this issue Jan 10, 2019 · 6 comments
Closed

Use a default values for a request Swagger UI documentation #5

zero0nee opened this issue Jan 10, 2019 · 6 comments

Comments

@zero0nee
Copy link

zero0nee commented Jan 10, 2019

First of all, amazing project @tiangolo !

I have a quick question. I want the request body example in the Swagger UI documentation to represent some API calls the user would want to make. However, all I can see are the default values I have set in the BaseModel like "string" (see image). How do I change the examples in the documentation without changing the BaseModel? E.g. I wan't an user using the API to get another default value than the value you see in the Swagger documentation.

image

@tiangolo
Copy link
Owner

First of all, amazing project @tiangolo !

Thanks! 🍰 🎉


Check it here: https://fastapi.tiangolo.com/tutorial/body-schema/#schema-extras

I just added a screenshot to the section in the docs too:


Now, one of the objectives of FastAPI is to have great documentation, easy to follow and find.

Do you think you would have found it more easily if it had a different name in the menu?

For example, instead of Body - Schema, something like Body - extra validations and info...

What keywords would you have looked for in the menu?

@zero0nee
Copy link
Author

Thank you for the quick response @tiangolo ! Good question, Don't know why I missed it. I would perhaps call it "Request body - Schema and examples". But what helps me, might not be helpful to other people and a bit too long.

I'm in absolute awe how fast, well documented, functional, cleaver and incredibly fas FastAPI is. I'm not lying, when I'm saying this is my favourite project on github. <3

@tiangolo
Copy link
Owner

Thank you for the quick response @tiangolo ! Good question, Don't know why I missed it. I would perhaps call it "Request body - Schema and examples". But what helps me, might not be helpful to other people and a bit too long.

Thanks for the feedback!

I'm in absolute awe how fast, well documented, functional, cleaver and incredibly fas FastAPI is. I'm not lying, when I'm saying this is my favourite project on github. <3

Thanks a lot. You put a big simile in my face 😁

@tiangolo
Copy link
Owner

I guess we were able to solve the issue, so I'll close it now. But feel free to re-open it, add more comments or create new ones.

@bobbycircle
Copy link

bobbycircle commented Jul 23, 2020

Hello, the example link above is now 404.. was it moved perhaps?
Never mind, I found it: https://fastapi.tiangolo.com/tutorial/schema-extra-example/

@github-actions
Copy link
Contributor

Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs.

@tiangolo tiangolo reopened this Feb 28, 2023
Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #8325 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants