Replies: 1 comment
-
|
Hey @md84419 ; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
I would like to define a enum with some values to be hidden from the schema.
I would like to define my Query to use the enum.
I would like the API to work with all the values defined in the enum, but the docs, redoc and schema to only show a subset of the values.
Is there a way to do this in FastAPI?
Edit 2023-04-07T21:40Z+1:
I've found a workaround.
This has the undesired side-effect that the API no longer validates that the supplied value is actually a member of FormatModel.
If one only does step 2, the schema ends up with an enumerated list consisting of both FormatModel and FormatModel.choices() (that is, with 5 members and with duplicates of 'json5' and 'csv').
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.95
Python Version
3.7
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions