schemars/json_schema_impls/uuid1.rs
1use crate::SchemaGenerator;
2use crate::{json_schema, JsonSchema, Schema};
3use alloc::borrow::Cow;
4use uuid1::Uuid;
5
6impl JsonSchema for Uuid {
7 inline_schema!();
8
9 fn schema_name() -> Cow<'static, str> {
10 "Uuid".into()
11 }
12
13 fn schema_id() -> Cow<'static, str> {
14 "uuid::Uuid".into()
15 }
16
17 fn json_schema(_: &mut SchemaGenerator) -> Schema {
18 json_schema!({
19 "type": "string",
20 "format": "uuid",
21 })
22 }
23}