Fast API Tutorial, Part 10: Declare Request Example Data

preview_player
Показать описание
The consumers of your API are all going to be geniuses because you're going to create really cool APIs. Let's assume, though, that it's a bit unclear what the data should actually look like in a request.

In this video we will see how you can actually provide a descriptive example to your users in the docs of your API.

Рекомендации по теме
Комментарии
Автор

well, as a french person, I understand your sense of humor 😂.
Btw, I have to tell you that your tutorial series is awesome!

pierrecwik
Автор

1:40 as of 5/19/2024
model_config = {
"json_schema_extra": {
"example": {
"name": "Foo",
"description": "A very nice Item",
"price": 16.25,
"tax": 1.67
}
}
}

rainerpavletic
Автор

Use openapi_examples instead of examples in 2024 :)

firdavscoder
Автор

thanks a lot. you are really doing well jobs for us!!1 keep it up.

sanjarkhamrakulov
Автор

Very nice and awesome video. A lot of thanks to author

Hanson-em
Автор

Currently trying to get multiple examples to show up as a drop down like you did. I followed your code and I didn't see it appear. I even went to to FastAPI examples doc page and copied their code snippet and it didn't appear either in /docs. I am using a new version (python 3.11.4 and FastAPI 0.100.0) but for most depreciated/removed things so far from your tutorial I have been able to figure out. For this instance there is no error from FastAPI /terminal...

phil
Автор

hey JVP i hope you are fine, you have a more complex tutorial where you applied all together as a bigger project, i am instersted to learn from you but in an more complete way if you have a paid course let me know where, greetings

packo
Автор

why the normal didn't showed in the drop down menu before you added the summary and description

SarthakBahuguna-ql
Автор

Hi! First of all, thank you very much. I have a problem. When you run the code, you can see properties such as price, name, tax in the request body, but I can't see them when I run my own code. My code works, and it doesn't give an error. What do you think could be the reason?

ozgekaragoz
visit shbcf.ru