Skip to content

Commit f988df9

Browse files
committed
[docs] update extractor docs: fix a typo, increase verbosity
1 parent a65d153 commit f988df9

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

dropshot/src/extractor/body.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ use std::fmt::Debug;
3030
// type. Only JSON is currently supported.
3131

3232
/// `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.
3638
#[derive(Debug)]
3739
pub struct TypedBody<BodyType: JsonSchema + DeserializeOwned + Send + Sync> {
3840
inner: BodyType,

dropshot/src/extractor/path.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ use schemars::JsonSchema;
1616
use serde::de::DeserializeOwned;
1717
use std::fmt::Debug;
1818

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.
2325
#[derive(Debug)]
2426
pub struct Path<PathType: JsonSchema + Send + Sync> {
2527
inner: PathType,

dropshot/src/extractor/query.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ use serde::de::DeserializeOwned;
1717
use std::fmt::Debug;
1818

1919
/// `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.
2326
#[derive(Debug)]
2427
pub struct Query<QueryType: DeserializeOwned + JsonSchema + Send + Sync> {
2528
inner: QueryType,

0 commit comments

Comments
 (0)