diff --git a/schemars/src/schema.rs b/schemars/src/schema.rs index 27cb048..6eb55e8 100644 --- a/schemars/src/schema.rs +++ b/schemars/src/schema.rs @@ -2,8 +2,7 @@ JSON Schema types. */ -use ref_cast::ref_cast_custom; -use ref_cast::RefCastCustom; +use ref_cast::{ref_cast_custom, RefCastCustom}; use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; @@ -175,6 +174,22 @@ impl From for Schema { } } +impl crate::JsonSchema for Schema { + fn schema_name() -> String { + "Schema".to_owned() + } + + fn schema_id() -> std::borrow::Cow<'static, str> { + "schemars::Schema".into() + } + + fn json_schema(_: &mut crate::gen::SchemaGenerator) -> Schema { + crate::json_schema!({ + "type": ["object", "boolean"] + }) + } +} + mod ser { use serde::ser::{Serialize, SerializeMap, SerializeSeq}; use serde_json::Value;