Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
Clarify docs for APIRouter dependencies#698
Merged
tiangolo merged 1 commit intofastapi:masterfromNov 27, 2019
marier-nico:clarify-router-dependencies-doc
Merged
Clarify docs for APIRouter dependencies#698tiangolo merged 1 commit intofastapi:masterfrommarier-nico:clarify-router-dependencies-doc
tiangolo merged 1 commit intofastapi:masterfrom
marier-nico:clarify-router-dependencies-doc
Conversation
Someone might expect that the dependencies specified on an APIRouter bepassed along to their path operation functions, though the behavior iscloser to dependencies specified in path operation decorators. Beingexplicit here will make the behavior unambiguous.
Member
tiangolo commentedNov 27, 2019
Great, thanks@marier-nico ! 📝 🍰 🎉 Thanks for the explanation / argument, and thanks for writing the update to the docs using the same conventions as in the rest of the docs (with italics for those keywords/names), very perceptive! 🤓 |
ContributorAuthor
marier-nico commentedNov 27, 2019
No problem, I'm happy I could contribute to the project! 😄 |
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 freeto 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.
Someone might expect that the dependencies specified on an APIRouter be passed along to their path operation functions, though the behavior is closer to dependencies specified in path operation decorators. Being explicit here will make the behavior unambiguous.
This is especially true for someone who might be jumping around in the documentation and who wouldn't necessarily have readdependencies in path operation decorators.