[go: nahoru, domu]

Skip to content
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 extract doc with optional extractors present in axum-extra #2801

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vsuryamurthy
Copy link
Contributor

This PR involves updating the documentation of extract in order to point the user to more optional extractors available in axum-extra.

@vsuryamurthy vsuryamurthy mentioned this pull request Jun 22, 2024
1 task
Copy link
Member
@jplatte jplatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new doc sentence seems to specify OptionalQuery behavior specifically, I've left some wording suggestions but feel free to make different suggestions yourself.

axum/src/docs/extract.md Outdated Show resolved Hide resolved
@@ -280,6 +280,9 @@ let app = Router::new().route("/users", post(create_user));
# let _: Router = app;
```

An alternate option is to make use of the optional extractors in [axum-extra] that return `None`
if there are no query parameters in the request or return `Some(T)` if deserialization was successful.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if there are no query parameters in the request or return `Some(T)` if deserialization was successful.
only for some rejections from their "base" extractor and reject the request otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestion is not quite clear to me.
Let me make a small change, maybe that helps.

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants