From cd26406fa95e7984f62700d4ea22765e81b2a1f3 Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Sat, 15 Feb 2025 23:01:42 +0300 Subject: [PATCH] feat: support hashbrown015 --- Cargo.lock | 12 +++++++++++- schemars/Cargo.toml | 2 ++ schemars/src/json_schema_impls/mod.rs | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index d574a44..f0abe4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -372,6 +372,15 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "serde", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -395,7 +404,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.5", "serde", ] @@ -796,6 +805,7 @@ dependencies = [ "dyn-clone", "either", "garde", + "hashbrown 0.15.2", "indexmap", "jsonschema", "pretty_assertions", diff --git a/schemars/Cargo.toml b/schemars/Cargo.toml index a3aa7b6..fb33fd1 100644 --- a/schemars/Cargo.toml +++ b/schemars/Cargo.toml @@ -20,6 +20,7 @@ dyn-clone = "1.0" ref-cast = "1.0.22" # optional dependencies +hashbrown015 = { version = "0.15", default-features = false, optional = true, package = "hashbrown" } arrayvec07 = { version = "0.7", default-features = false, optional = true, package = "arrayvec" } bigdecimal04 = { version = "0.4", default-features = false, optional = true, package = "bigdecimal" } bytes1 = { version = "1.0", default-features = false, optional = true, package = "bytes" } @@ -46,6 +47,7 @@ garde = { git = "https://github.com/jprochazk/garde.git", rev = "be00ddddf8de145 validator = { version = "0.18.1", features = ["derive"] } regex = { version = "1.10.6", default-features = false } +hashbrown015 = { version = "0.15", default-features = false, features = ["serde"], package = "hashbrown" } arrayvec07 = { version = "0.7", default-features = false, features = ["serde"], package = "arrayvec"} bigdecimal04 = { version = "0.4", default-features = false, features = ["serde"], package = "bigdecimal" } bytes1 = { version = "1.0", default-features = false, features = ["serde"], package = "bytes" } diff --git a/schemars/src/json_schema_impls/mod.rs b/schemars/src/json_schema_impls/mod.rs index c4e4c51..0b5e029 100644 --- a/schemars/src/json_schema_impls/mod.rs +++ b/schemars/src/json_schema_impls/mod.rs @@ -86,6 +86,9 @@ forward_impl!(smol_str02::SmolStr => alloc::string::String); #[cfg(feature = "compact_str08")] forward_impl!(compact_str08::CompactString => alloc::string::String); +#[cfg(feature = "hashbrown015")] +forward_impl!(( crate::JsonSchema for hashbrown015::HashMap) => std::collections::HashMap); + #[cfg(feature = "url2")] mod url2;