schemars/json_schema_impls/
mod.rs
1macro_rules! inline_schema {
2 () => {
3 fn inline_schema() -> bool {
4 true
5 }
6 };
7}
8
9macro_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
44mod array;
45mod core;
46mod maps;
47mod nonzero;
48mod primitives;
49mod sequences;
50mod serdejson;
51mod std_time;
52mod tuple;
53mod wrapper;
54
55mod atomic;
56
57#[cfg(feature = "std")]
58mod ffi;
59
60#[cfg(feature = "arrayvec07")]
61mod arrayvec07;
62
63#[cfg(feature = "bytes1")]
64mod bytes1;
65
66#[cfg(feature = "chrono04")]
67mod chrono04;
68
69#[cfg(any(feature = "rust_decimal1", feature = "bigdecimal04"))]
70mod decimal;
71
72#[cfg(feature = "either1")]
73mod either1;
74
75#[cfg(feature = "indexmap2")]
76mod indexmap2;
77
78#[cfg(feature = "jiff02")]
79mod jiff02;
80
81#[cfg(feature = "semver1")]
82mod semver1;
83
84#[cfg(feature = "smallvec1")]
85forward_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")]
88forward_impl!(smol_str02::SmolStr => alloc::string::String);
89
90#[cfg(feature = "url2")]
91mod url2;
92
93#[cfg(feature = "uuid1")]
94mod uuid1;