-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[doc] Added notes about extractor precedence #1324
[doc] Added notes about extractor precedence #1324
Conversation
Both JSON and Form extractors consume the Body when they run, so they need to be last in the order of extractors. Added a note in the structs docs themselves pointing to the relevant part of the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is worth having!
I think we should add it to the other types we have that only implement `FromRequest:
BodyStream
RawBody
Multipart
ContentLengthLimit
, note this one is conditional, only if what its wrapping implementsFromRequest
. The docs should mention that.
- Added documentation snippet to BodyStream, RawBody, Multipart - Added documentation about the inner type of ContentLengthLimit - Fixed link type in State
All comments are addressed (I think!) |
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
Well, CI failed :) will fix that later today. |
I need to check my editor config...
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Added a note in the structs docs pointing to the relevant part of the documentation regarding extractor precedence.
Motivation
During discussion of a slightly unrelated problem (#1321), it was discovered that my example was ordering the extractors wrong, causing a compile-time problem.
Solution
This PR should hopefully make the solution for the above problem (reordering extractors) a little bit more discoverable.