Skip to content

Commit

Permalink
Clarify the explanation to use optional extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
vsuryamurthy committed Jun 24, 2024
1 parent 6423bb7 commit ae3f1ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions axum/src/docs/extract.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ let app = Router::new().route("/users", post(create_user));
# let _: Router = app;
```

Another 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.
Another option is to make use of the optional extractors in [axum-extra] that
either returns `None` if there are no query parameters in the request URI,
or returns `Some(T)` if deserialization was successful.
If the deserialization was not successful, the request is rejected.

# Customizing extractor responses

Expand Down

0 comments on commit ae3f1ab

Please sign in to comment.