📝 Fix type of username in /docs_src/security to allow None#12494
Closed
vittxr wants to merge 3 commits into
Closed
📝 Fix type of username in /docs_src/security to allow None#12494vittxr wants to merge 3 commits into
username in /docs_src/security to allow None#12494vittxr wants to merge 3 commits into
Conversation
Contributor
|
📝 Docs preview for commit b1f77cc at: https://84971188.fastapitiangolo.pages.dev |
Contributor
|
📝 Docs preview for commit 460f956 at: https://dde0f9f1.fastapitiangolo.pages.dev |
None in username for the docs snippets located in /docs_src/securityusername in /docs_src/security to allow None
svlandeg
approved these changes
Feb 5, 2025
svlandeg
left a comment
Member
There was a problem hiding this comment.
Thanks for catching this! Yes, makes sense.
Member
|
As a quick note, it looks like the test suite is failing due to something outside of this PR. We're looking into it! |
Contributor
|
📝 Docs preview for commit 397ed72 at: https://de45a47a.fastapitiangolo.pages.dev |
Author
|
All tests passed. I think it's ok now |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the docs > security section, there is a type issue
username: str = payload.get("sub")Since
.get()may return None, theusernamevariable should accommodate this possibility by using:username: str | None = payload.get("sub")I've fixed
/docs_src/securitysnippets