Cargo Features

schemars = { version = "0.8.16", default-features = false, features = ["derive", "preserve_order", "impl_json_schema", "derive_json_schema", "uuid", "arrayvec", "indexmap1", "raw_value", "bigdecimal", "ui_test", "chrono", "indexmap2", "either", "uuid1", "smallvec", "arrayvec07", "url", "bytes", "rust_decimal", "bigdecimal04", "enumset", "smol_str", "semver"] }
default = derive

The derive feature is set by default whenever schemars is added without default-features = false somewhere in the dependency tree.

derive default impl_json_schema? = schemars_derive
preserve_order = indexmap

Use a different representation for the map type of Schemars.
This allows data to be read into a Value and written back to a JSON string while preserving the order of map keys in the input.

Affects schemars::Map, schemars::MapEntry

impl_json_schema derive_json_schema? = derive
derive_json_schema = impl_json_schema

derive_json_schema will be removed in a later version

uuid = uuid08

uuid feature contains uuid08 only for back-compat - will be changed to include uuid 1.0 instead in a later version

arrayvec = arrayvec05

arrayvec feature without version suffix is included only for back-compat - will be removed in a later version

indexmap1 = indexmap

Enables raw_value of serde_json

bigdecimal = bigdecimal03

bigdecimal feature without version suffix is included only for back-compat - will be removed in a later version


Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

schemars_derive derive
chrono implicit feature
indexmap indexmap1? preserve_order?

Enables serde-1 of indexmap ^1.2

indexmap2 implicit feature

Enables serde and default (std) of indexmap

either implicit feature
uuid08 uuid?

Enables uuid ^0.8

uuid1 implicit feature

Enables uuid

smallvec implicit feature
arrayvec05 arrayvec?

Enables arrayvec ^0.5

arrayvec07 implicit feature

Enables arrayvec

url implicit feature
bytes implicit feature

With default (std)

rust_decimal implicit feature
bigdecimal03 bigdecimal?

Enables bigdecimal ^0.3

bigdecimal04 implicit feature

Enables bigdecimal

enumset implicit feature
smol_str implicit feature

Enables default (std) of smol_str ^0.1.17

semver implicit feature

With serde and default (std)