pub enum ChangeKind {
Show 14 variants
TypeAdd {
added: JsonSchemaType,
},
TypeRemove {
removed: JsonSchemaType,
},
ConstAdd {
added: Value,
},
ConstRemove {
removed: Value,
},
PropertyAdd {
lhs_additional_properties: bool,
added: String,
},
PropertyRemove {
lhs_additional_properties: bool,
removed: String,
},
RangeAdd {
added: Range,
},
RangeRemove {
removed: Range,
},
RangeChange {
old_value: Range,
new_value: Range,
},
TupleToArray {
old_length: usize,
},
ArrayToTuple {
new_length: usize,
},
TupleChange {
new_length: usize,
},
RequiredRemove {
property: String,
},
RequiredAdd {
property: String,
},
}
Expand description
The kind of change + data relevant to the change.
Variants§
TypeAdd
A type has been added and is now additionally allowed.
Fields
added: JsonSchemaType
The type in question.
TypeRemove
A type has been removed and is no longer allowed.
Fields
removed: JsonSchemaType
The type in question.
ConstAdd
A const value has been added as an allowed value.
ConstRemove
A const has been removed as an allowed value.
PropertyAdd
A property has been added and (depending on additionalProperties) is now additionally allowed.
Fields
PropertyRemove
A property has been removed and (depending on additionalProperties) might now no longer be allowed.
Fields
RangeAdd
A minimum/maximum constraint has been added.
RangeRemove
A minimum/maximum constraint has been removed.
RangeChange
A minimum/maximum constraint has been updated.
TupleToArray
An array-type item has been changed from tuple validation to array validation.
See https://json-schema.org/understanding-json-schema/reference/array.html
Changes will still be emitted for inner items.
ArrayToTuple
An array-type item has been changed from array validation to tuple validation.
See https://json-schema.org/understanding-json-schema/reference/array.html
Changes will still be emitted for inner items.
TupleChange
An array-type item with tuple validation has changed its length (“items” array got longer or shorter.
See https://json-schema.org/understanding-json-schema/reference/array.html
Changes will still be emitted for inner items.
RequiredRemove
A previously required property has been removed
RequiredAdd
A previously optional property has been made required
Implementations§
Source§impl ChangeKind
impl ChangeKind
Sourcepub fn is_breaking(&self) -> bool
pub fn is_breaking(&self) -> bool
Whether the change is breaking.
What is considered breaking is WIP. Changes are intentionally exposed as-is in public API so that the user can develop their own logic as to what they consider breaking.
Currently the rule of thumb is, a change is breaking if it would cause messages that used to validate fine under RHS to no longer validate under LHS.