| 1 | macro_rules! inline_schema { |
| 2 | () => { |
| 3 | fn inline_schema() -> bool { |
| 4 | true |
| 5 | } |
| 6 | }; |
| 7 | } |
| 8 | |
| 9 | macro_rules! forward_impl { |
| 10 | (($($impl:tt)+) => $target:ty) => { |
| 11 | impl $($impl)+ { |
| 12 | fn inline_schema() -> bool { |
| 13 | <$target as $crate::JsonSchema>::inline_schema() |
| 14 | } |
| 15 | |
| 16 | fn schema_name() -> alloc::borrow::Cow<'static, str> { |
| 17 | <$target as $crate::JsonSchema>::schema_name() |
| 18 | } |
| 19 | |
| 20 | fn schema_id() -> alloc::borrow::Cow<'static, str> { |
| 21 | <$target as $crate::JsonSchema>::schema_id() |
| 22 | } |
| 23 | |
| 24 | fn json_schema(generator: &mut $crate::SchemaGenerator) -> $crate::Schema { |
| 25 | <$target as $crate::JsonSchema>::json_schema(generator) |
| 26 | } |
| 27 | |
| 28 | fn _schemars_private_non_optional_json_schema(generator: &mut $crate::SchemaGenerator) -> $crate::Schema { |
| 29 | #[allow(clippy::used_underscore_items)] |
| 30 | <$target as $crate::JsonSchema>::_schemars_private_non_optional_json_schema(generator) |
| 31 | } |
| 32 | |
| 33 | fn _schemars_private_is_option() -> bool { |
| 34 | #[allow(clippy::used_underscore_items)] |
| 35 | <$target as $crate::JsonSchema>::_schemars_private_is_option() |
| 36 | } |
| 37 | } |
| 38 | }; |
| 39 | ($ty:ty => $target:ty) => { |
| 40 | forward_impl!(($crate::JsonSchema for $ty) => $target); |
| 41 | }; |
| 42 | } |
| 43 | |
| 44 | mod array; |
| 45 | mod core; |
| 46 | mod maps; |
| 47 | mod nonzero; |
| 48 | mod primitives; |
| 49 | mod sequences; |
| 50 | mod serdejson; |
| 51 | mod std_time; |
| 52 | mod tuple; |
| 53 | mod wrapper; |
| 54 | |
| 55 | mod atomic; |
| 56 | |
| 57 | #[cfg(feature = "std")] |
| 58 | mod ffi; |
| 59 | |
| 60 | #[cfg(feature = "arrayvec07")] |
| 61 | mod arrayvec07; |
| 62 | |
| 63 | #[cfg(feature = "bytes1")] |
| 64 | mod bytes1; |
| 65 | |
| 66 | #[cfg(feature = "chrono04")] |
| 67 | mod chrono04; |
| 68 | |
| 69 | #[cfg(any(feature = "rust_decimal1", feature = "bigdecimal04"))] |
| 70 | mod decimal; |
| 71 | |
| 72 | #[cfg(feature = "either1")] |
| 73 | mod either1; |
| 74 | |
| 75 | #[cfg(feature = "indexmap2")] |
| 76 | mod indexmap2; |
| 77 | |
| 78 | #[cfg(feature = "jiff02")] |
| 79 | mod jiff02; |
| 80 | |
| 81 | #[cfg(feature = "semver1")] |
| 82 | mod semver1; |
| 83 | |
| 84 | #[cfg(feature = "smallvec1")] |
| 85 | forward_impl!((<A: smallvec1::Array> crate::JsonSchema for smallvec1::SmallVec<A> where A::Item: crate::JsonSchema) => alloc::vec::Vec<A::Item>); |
| 86 | |
| 87 | #[cfg(feature = "smol_str02")] |
| 88 | forward_impl!(smol_str02::SmolStr => alloc::string::String); |
| 89 | |
| 90 | #[cfg(feature = "smol_str03")] |
| 91 | forward_impl!(smol_str03::SmolStr => alloc::string::String); |
| 92 | |
| 93 | #[cfg(feature = "url2")] |
| 94 | mod url2; |
| 95 | |
| 96 | #[cfg(feature = "uuid1")] |
| 97 | mod uuid1; |