Cover serde_json RawValue type by schemars

This commit is contained in:
Łukasz Biel 2022-10-13 13:09:54 +02:00 committed by Graham Esau
parent 5836afbd64
commit cb392d1829
2 changed files with 15 additions and 0 deletions

View file

@ -60,6 +60,8 @@ uuid = ["uuid08"]
arrayvec = ["arrayvec05"] arrayvec = ["arrayvec05"]
indexmap1 = ["indexmap"] indexmap1 = ["indexmap"]
raw_value = ["serde_json/raw_value"]
ui_test = [] ui_test = []
[[test]] [[test]]

View file

@ -33,3 +33,16 @@ impl JsonSchema for Number {
.into() .into()
} }
} }
#[cfg(feature = "raw_value")]
impl JsonSchema for serde_json::value::RawValue {
no_ref_schema!();
fn schema_name() -> String {
"AnyValue".to_owned()
}
fn json_schema(_: &mut SchemaGenerator) -> Schema {
Schema::Bool(true)
}
}