diff --git a/schemars/Cargo.toml b/schemars/Cargo.toml index fb6b06e5..126c205a 100644 --- a/schemars/Cargo.toml +++ b/schemars/Cargo.toml @@ -34,6 +34,7 @@ rust_decimal = { version = "1", default-features = false, optional = true } bigdecimal03 = { version = "0.3", default-features = false, optional = true, package = "bigdecimal" } bigdecimal04 = { version = "0.4", default-features = false, optional = true, package = "bigdecimal" } enumset = { version = "1.0", optional = true } +im = { version = "15.1.0", optional = true } smol_str = { version = "0.1.17", optional = true } semver = { version = "1.0.9", features = ["serde"], optional = true } diff --git a/schemars/src/json_schema_impls/im.rs b/schemars/src/json_schema_impls/im.rs new file mode 100644 index 00000000..3eb31efe --- /dev/null +++ b/schemars/src/json_schema_impls/im.rs @@ -0,0 +1,10 @@ +use crate::gen::SchemaGenerator; +use crate::schema::*; +use crate::JsonSchema; +use im; + +forward_impl!(( JsonSchema for im::HashSet) => std::collections::HashSet); +forward_impl!(( JsonSchema for im::HashMap) => std::collections::HashMap); +forward_impl!(( JsonSchema for im::OrdSet) => std::collections::HashSet); +forward_impl!(( JsonSchema for im::OrdMap) => std::collections::HashMap); +forward_impl!(( JsonSchema for im::Vector) => std::vec::Vec); diff --git a/schemars/src/json_schema_impls/mod.rs b/schemars/src/json_schema_impls/mod.rs index 0c548eb3..b7a81c48 100644 --- a/schemars/src/json_schema_impls/mod.rs +++ b/schemars/src/json_schema_impls/mod.rs @@ -62,6 +62,8 @@ mod either; #[cfg(feature = "enumset")] mod enumset; mod ffi; +#[cfg(feature = "im")] +mod im; #[cfg(feature = "indexmap")] mod indexmap; #[cfg(feature = "indexmap2")]