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