1.2 KiB
1.2 KiB
| layout | title | nav_order | permalink |
|---|---|---|---|
| default | Feature Flags | 5 | /features/ |
Feature Flags and Optional Dependencies
Some functionality can be selectively enabled/disabled via Cargo features. These can be enabled when you add Schemars to your crate's cargo.toml, e.g.
[dependencies]
schemars = { version = "0.6", features = ["chrono"] }
Feature Flags
derive(enabled by default) - provides#[derive(JsonSchema)]macroimpl_json_schema- implementsJsonSchemafor Schemars types themselvespreserve_order- keep the order of struct fields inSchemaandSchemaObject
Optional Dependencies
Schemars can implement JsonSchema on types from several popular crates, enabled via optional dependencies (dependency versions are shown in brackets):