1use schemars::{
10 JsonSchema,
11 r#gen::SchemaGenerator,
12 schema::{InstanceType, Schema, SchemaObject},
13};
14
15pub struct Hostname;
17
18impl JsonSchema for Hostname {
19 fn schema_name() -> String {
20 "Hostname".to_string()
21 }
22
23 fn json_schema(generator: &mut SchemaGenerator) -> Schema {
24 hostname(generator)
25 }
26}
27
28fn hostname(_gen: &mut SchemaGenerator) -> Schema {
29 Schema::Object(SchemaObject {
30 instance_type: Some(InstanceType::String.into()),
31 format: Some("hostname".to_owned()),
32 ..SchemaObject::default()
33 })
34}