pub enum Kind {
Show 17 variants
Any,
Null,
Bool,
ConstBool(bool),
ConstString(String),
Enum(Vec<String>),
String {
min_length: Option<usize>,
pattern: Option<String>,
},
Integer {
min: Option<f64>,
exclusive_min: Option<f64>,
max: Option<f64>,
},
Number {
min: Option<f64>,
exclusive_min: Option<f64>,
max: Option<f64>,
},
Array {
items: Box<ShapeDef>,
min_items: Option<usize>,
max_items: Option<usize>,
unique: bool,
},
Map {
values: Box<ShapeDef>,
min_properties: Option<usize>,
key_pattern: Option<String>,
},
Object(ObjectDef),
OneOf(Vec<ShapeDef>),
Tagged {
tag: String,
variants: Vec<(String, ShapeDef)>,
},
Not(Box<ShapeDef>),
AllOf(Vec<ShapeDef>),
Ref(String),
}Expand description
What a value of a shape looks like.
Variants§
Any
Any JSON value.
Null
Bool
ConstBool(bool)
Exactly this boolean.
ConstString(String)
Exactly this string.
Enum(Vec<String>)
One of these strings.
String
A string, at least min_length characters long (Unicode scalar values, as JSON Schema counts them) and,
when pattern is given, matching it.
Integer
A whole number between the bounds. A number written with a zero fraction (97.0) is whole, as in JSON Schema.
Number
Array
Map
An object whose every value has one shape, with keys that match key_pattern when it is given.
Object(ObjectDef)
OneOf(Vec<ShapeDef>)
A value that matches exactly one of the alternatives.
Tagged
An object chosen by the string under tag: every variant is an object that holds tag as a constant.
Not(Box<ShapeDef>)
A value that does not match the shape.
AllOf(Vec<ShapeDef>)
A value that matches every shape. Written as one schema node when the shapes use different keywords, and as
allOf when they do not.
Ref(String)
A named definition.