-
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. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
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 What keywords would you have looked for in the menu? |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback!
Thanks a lot. You put a big simile in my face 😁 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Hello, the example link above is now 404.. was it moved perhaps? |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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 likeBody - extra validations and info
...What keywords would you have looked for in the menu?