You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When two ore more Body() fields are added indirectly and are bound to the same variable name, only the last one will be visible in docs. Aliasing them will not make any difference.
The example above will show only field_0 and field_2 in the docs, while field_1 is missing.
When trying to execute the endpoint it will operate correctly.
If there are two different dependencies using internally the same variable name for different body values, it will also not work.
This discussion was converted from issue #4610 on February 28, 2023 16:13.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
When two ore more
Body()fields are added indirectly and are bound to the same variable name, only the last one will be visible in docs. Aliasing them will not make any difference.The example above will show only field_0 and field_2 in the docs, while field_1 is missing.
When trying to execute the endpoint it will operate correctly.
If there are two different dependencies using internally the same variable name for different body values, it will also not work.
Operating System
Other
Operating System Details
No response
FastAPI Version
0.74.1
Python Version
3.10.1
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions