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
Update docs with parameters that default to None to use Optional #1561
Comments
I'll be working on this with @chrisngyn and @YKo20010 |
Thanks a lot! |
@tiangolo Is this available to take up? |
@tiangolo is this fixed or do you want someone to take it up a quick search through the docs makes it look all solved? |
This issue was solved on #1644 To confirm I've made a quick search and the docs are following the request on this issue. 🤓 |
Is this still up for grabs? @tiangolo |
Can I work on this issue? |
Ah, I forgot to close my own issue! Haha. This is done now. ✅ Thanks for the interest and discussion everyone! ☕ |
First check
Example
Here's a self-contained minimal, reproducible, example with my use case:
Description
q
can beNone
and thatq.lower()
could raise an error.The solution you would like
I would like the examples in the docs to use
Optional
:By using
Optional
the editor would be able to warn thatq.lower()
could raise an error ifq
isNone
.Describe alternatives you've considered
To leave it as is.
Environment
To know the FastAPI version use:
python -c "import fastapi; print(fastapi.__version__)"
To know the Python version use:
Additional context
I was waiting to first introduce
Optional
in the docs, but it was done in #1377 🎉The new docs are here: https://fastapi.tiangolo.com/python-types/#optional
Now it's a good moment to update all the examples that have a default of
None
in all the docs to also useOptional
.The text was updated successfully, but these errors were encountered: