-
|
Hi all, Quick question about how to manage optional query paramters :
I've seen it with solutions using Swagger, so I assume this should be possible, but I didn't find a way to do in documentation (or maybe I missed it...) Thanks a lot, Environment
0.63.0
Python 3.6.9 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
|
If the parameter you define is an enum, you will automatically get this functionality |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Thanks a lot, that works as expected. Thanks again, |
Beta Was this translation helpful? Give feedback.
-
You can use the functional api to dynamically create an enum.
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the help here @Mause and @Kilo59 ! 👏 🙇 If the data you need to validate comes from a database you probably need to use dependencies for that: https://fastapi.tiangolo.com/tutorial/dependencies/
|
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.
If the parameter you define is an enum, you will automatically get this functionality