Skip to content

Commit

Permalink
Support bigdecimal 0.4 (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers authored Sep 17, 2023
1 parent 0084f1a commit cc28738
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion schemars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ arrayvec07 = { version = "0.7", default-features = false, optional = true, packa
url = { version = "2.0", default-features = false, optional = true }
bytes = { version = "1.0", optional = true }
rust_decimal = { version = "1", default-features = false, optional = true }
bigdecimal = { version = "0.3", 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 }
smol_str = { version = "0.1.17", optional = true }
semver = { version = "1.0.9", features = ["serde"], optional = true }
Expand Down Expand Up @@ -61,6 +62,9 @@ arrayvec = ["arrayvec05"]
indexmap1 = ["indexmap"]

raw_value = ["serde_json/raw_value"]
# `bigdecimal` feature without version suffix is included only for back-compat - will be removed in a later version
bigdecimal = ["bigdecimal03"]
bigdecimal04 = ["dep:bigdecimal04"]

ui_test = []

Expand Down
4 changes: 3 additions & 1 deletion schemars/src/json_schema_impls/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ macro_rules! decimal_impl {
#[cfg(feature = "rust_decimal")]
decimal_impl!(rust_decimal::Decimal);
#[cfg(feature = "bigdecimal")]
decimal_impl!(bigdecimal::BigDecimal);
decimal_impl!(bigdecimal03::BigDecimal);
#[cfg(feature = "bigdecimal04")]
decimal_impl!(bigdecimal04::BigDecimal);

0 comments on commit cc28738

Please sign in to comment.