Note required 'json' crate feature in guide.

Co-authored-by: Manuel <2084639+tennox@users.noreply.github.com>
This commit is contained in:
Sergio Benitez 2023-05-24 09:55:28 -07:00
parent 36a5c82e8b
commit e447d7c95b
1 changed files with 2 additions and 0 deletions

View File

@ -446,6 +446,8 @@ fn todo() -> Json<Task> {
}
```
! note: You must enable Rocket's `json` crate feature to use the [`Json`] type.
The `Json` type serializes the structure into JSON, sets the Content-Type to
JSON, and emits the serialized data in a fixed-sized body. If serialization
fails, a **500 - Internal Server Error** is returned.