-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
How can we reflect the optional/required json items in documentation #388
Comments
Are you asking about optional/required fields of the JSON body? |
@haizaar - yes, that's about reflecting the optional/required json elements in the body for swagger documentation |
It's working out of the box, if you use pydantic objects the generated schema will "translate" the requirements, for instance this pydantic object from the very beginning of the documentation (https://pydantic-docs.helpmanual.io/):
used this way:
shows in the documentation as So quoting pydantic doc, you can check
|
which makes me think reading the spec on |
@euri10, What if you define the handler as |
if you do that @haizaar the red "required" next to the Request Body disappears |
Which makes sense according to spec I assume, right?
…On Tue, 16 Jul 2019 at 23:47, euri10 ***@***.***> wrote:
if you do that @haizaar <https://github.com/haizaar> the red "required"
next to the Request Body disappears
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#388>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAOGWJ3T34J5LV7OVBU5PTP7XGNDANCNFSM4IDVCTHQ>
.
--
Zaar
|
yep indeed, seems like I got things reversed, like right and left, one day it'll be better :) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description
How can I mark the optional/required json elements in the swagger documentation generated using FastAPI?
Currently, for POST verb, it just marked "* required" for the whole body and not individual json elements.
The text was updated successfully, but these errors were encountered: