File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,11 @@ use std::fmt::Debug;
30
30
// type. Only JSON is currently supported.
31
31
32
32
/// `TypedBody<BodyType>` is an extractor used to deserialize an instance of
33
- /// `BodyType` from an HTTP request body. `BodyType` is any structure of yours
34
- /// that implements `serde::Deserialize`. See this module's documentation for
35
- /// more information.
33
+ /// `BodyType` from an HTTP request body. `BodyType` may be any struct of yours
34
+ /// that implements [serde::Deserialize] and [schemars::JsonSchema], where
35
+ /// primitives and enums have to be wrapped in an outer struct and enums need
36
+ /// to be flattened using the `#[serde(flatten)]` attribute. See this module's
37
+ /// documentation formore information.
36
38
#[ derive( Debug ) ]
37
39
pub struct TypedBody < BodyType : JsonSchema + DeserializeOwned + Send + Sync > {
38
40
inner : BodyType ,
Original file line number Diff line number Diff line change @@ -16,10 +16,12 @@ use schemars::JsonSchema;
16
16
use serde:: de:: DeserializeOwned ;
17
17
use std:: fmt:: Debug ;
18
18
19
- /// `Path<PathType>` is an extractor used to deserialize an instance of
20
- /// `PathType` from an HTTP request's path parameters. `PathType` is any
21
- /// structure of yours that implements [serde::Deserialize] and
22
- /// [schemars::JsonSchema]. See the crate documentation for more information.
19
+ /// `Path<PathType>` is an extractor used to deserialize an instance of
20
+ /// `PathType` from an HTTP request's path parameters. `PathType` may be any
21
+ /// struct of yours that implements [serde::Deserialize] and
22
+ /// [schemars::JsonSchema], where primitives and enums have to be wrapped in an
23
+ /// outer struct and enums need to be flattened using the `#[serde(flatten)]`
24
+ /// attribute. See this module's documentation formore information.
23
25
#[ derive( Debug ) ]
24
26
pub struct Path < PathType : JsonSchema + Send + Sync > {
25
27
inner : PathType ,
Original file line number Diff line number Diff line change @@ -17,9 +17,12 @@ use serde::de::DeserializeOwned;
17
17
use std:: fmt:: Debug ;
18
18
19
19
/// `Query<QueryType>` is an extractor used to deserialize an instance of
20
- /// `QueryType` from an HTTP request's query string. `QueryType` is any
21
- /// structure of yours that implements [serde::Deserialize] and
22
- /// [schemars::JsonSchema]. See the crate documentation for more information.
20
+ /// `QueryType` from an HTTP request's query string. `QueryType` may be any
21
+ /// struct of yours that implements [serde::Deserialize] and
22
+ /// [schemars::JsonSchema], where primitives and enums have to be wrapped in
23
+ /// an outer struct and enums need to be flattened using the
24
+ /// `#[serde(flatten)]` attribute. See this module's documentation for more
25
+ /// information.
23
26
#[ derive( Debug ) ]
24
27
pub struct Query < QueryType : DeserializeOwned + JsonSchema + Send + Sync > {
25
28
inner : QueryType ,
You can’t perform that action at this time.
0 commit comments