Update optional dependencies docs
This commit is contained in:
parent
c46873ffb9
commit
ec0a01b82b
5 changed files with 31 additions and 24 deletions
|
@ -1,5 +1,9 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## next
|
||||||
|
### Added:
|
||||||
|
- Implemented `JsonSchema` on types from `smallvec` and `arrayvec` (as optional dependencies)
|
||||||
|
|
||||||
## 0.6.4 - 2019-12-27
|
## 0.6.4 - 2019-12-27
|
||||||
### Added:
|
### Added:
|
||||||
- Implemented `JsonSchema` on types from `indexmap`, `either` and `uuid` (as optional dependencies)
|
- Implemented `JsonSchema` on types from `indexmap`, `either` and `uuid` (as optional dependencies)
|
||||||
|
|
12
README.md
12
README.md
|
@ -207,9 +207,13 @@ 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.
|
`#[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
|
## Feature Flags
|
||||||
- `chrono` - implements `JsonSchema` for all [Chrono](https://github.com/chronotope/chrono) types which are serializable by Serde.
|
|
||||||
- `indexmap` - implements `JsonSchema` on `IndexMap` and `IndexSet` from [indexmap](https://github.com/bluss/indexmap).
|
|
||||||
- `either` - implements `JsonSchema` on [`Either`](https://github.com/bluss/either).
|
|
||||||
- `uuid` - implements `JsonSchema` on [`Uuid`](https://github.com/uuid-rs/uuid).
|
|
||||||
- `impl_json_schema` - implements `JsonSchema` for Schemars types themselves
|
- `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)
|
||||||
|
|
|
@ -13,21 +13,14 @@ Some functionality can be selectively enabled/disabled via [Cargo features](http
|
||||||
schemars = { version = "0.6", features = ["chrono"] }
|
schemars = { version = "0.6", features = ["chrono"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
<div class="indented">
|
## Feature Flags
|
||||||
|
- `impl_json_schema` - implements `JsonSchema` for Schemars types themselves
|
||||||
|
|
||||||
### impl_json_schema
|
## Optional Dependencies
|
||||||
Implements `JsonSchema` on Schemars types themselves.
|
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)
|
||||||
### chrono
|
- [`indexmap`](https://crates.io/crates/indexmap) (^1.2)
|
||||||
Implements `JsonSchema` on all [Chrono](https://github.com/chronotope/chrono) types which are serializable by Serde.
|
- [`either`](https://crates.io/crates/either) (^1.3)
|
||||||
|
- [`uuid`](https://crates.io/crates/uuid) (^0.8)
|
||||||
### indexmap
|
- [`smallvec`](https://crates.io/crates/uuid) (^1.0)
|
||||||
Implements `JsonSchema` on `IndexMap` and `IndexSet` from [indexmap](https://github.com/bluss/indexmap).
|
- [`arrayvec`](https://crates.io/crates/arrayvec) (^0.5)
|
||||||
|
|
||||||
### either
|
|
||||||
Implements `JsonSchema` on [`Either`](https://github.com/bluss/either).
|
|
||||||
|
|
||||||
### uuid
|
|
||||||
Implements `JsonSchema` on [`Uuid`](https://github.com/uuid-rs/uuid).
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
|
@ -23,8 +23,6 @@ either = { version = "1.3", default-features = false, optional = true }
|
||||||
uuid = { version = "0.8", default-features = false, optional = true }
|
uuid = { version = "0.8", default-features = false, optional = true }
|
||||||
smallvec = { version = "1.0", optional = true }
|
smallvec = { version = "1.0", optional = true }
|
||||||
arrayvec = { version = "0.5", default-features = false, 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]
|
[dev-dependencies]
|
||||||
pretty_assertions = "0.6.1"
|
pretty_assertions = "0.6.1"
|
||||||
|
|
|
@ -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.
|
`#[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
|
## 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
|
- `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.
|
/// The map type used by schemars types.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue