Explicitly doc enabling 'json' feature in guide.

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Matthew Pomes 2021-07-20 08:58:24 -05:00 committed by Sergio Benitez
parent 8825f936ef
commit a05b3e138c
1 changed files with 13 additions and 1 deletions

View File

@ -677,7 +677,19 @@ struct Task<'r> {
fn new(task: Json<Task<'_>>) { /* .. */ } fn new(task: Json<Task<'_>>) { /* .. */ }
``` ```
See the [JSON example](@example/serialization/src/json.rs) on GitHub for a complete example. ! note: JSON support requires enabling Rocket's `json` feature flag.
Rocket intentionally places JSON support, as well support for other data
formats and features, behind feature flags. See [the api
docs](@api/rocket/#features) for a list of available features. The `json`
feature can be enabled in the `Cargo.toml`:
`
rocket = { version = "0.5.0-rc.1", features = ["json"] }
`
See the [JSON example](@example/serialization/src/json.rs) on GitHub for a
complete example.
### Temporary Files ### Temporary Files