Update optional dependencies docs

This commit is contained in:
Graham Esau 2019-12-29 00:28:54 +00:00
parent c46873ffb9
commit ec0a01b82b
5 changed files with 31 additions and 24 deletions

View file

@ -23,8 +23,6 @@ either = { version = "1.3", default-features = false, optional = true }
uuid = { version = "0.8", default-features = false, optional = true }
smallvec = { version = "1.0", optional = true }
arrayvec = { version = "0.5", default-features = false, optional = true }
# TODO implement JsonSchema on bytes types. bytes 0.5 requires Rust 1.39+
# bytes = { version = "0.5", default-features = false, optional = true }
[dev-dependencies]
pretty_assertions = "0.6.1"

View file

@ -201,8 +201,16 @@ fn main() {
`#[serde(...)]` attributes can be overriden using `#[schemars(...)]` attributes, which behave identically (e.g. `#[schemars(rename_all = "camelCase")]`). You may find this useful if you want to change the generated schema without affecting Serde's behaviour, or if you're just not using Serde.
## Feature Flags
- `chrono` - implements `JsonSchema` for all [Chrono](https://github.com/chronotope/chrono) types which are serializable by Serde.
- `impl_json_schema` - implements `JsonSchema` for Schemars types themselves
## Optional Dependencies
Schemars can implement `JsonSchema` on types from several popular crates, enabled via optional dependencies (dependency versions are shown in brackets):
- [`chrono`](https://crates.io/crates/chrono) (^0.4)
- [`indexmap`](https://crates.io/crates/indexmap) (^1.2)
- [`either`](https://crates.io/crates/either) (^1.3)
- [`uuid`](https://crates.io/crates/uuid) (^0.8)
- [`smallvec`](https://crates.io/crates/uuid) (^1.0)
- [`arrayvec`](https://crates.io/crates/arrayvec) (^0.5)
*/
/// The map type used by schemars types.