pub enum ChangeKind {
Show 28 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,
},
FormatAdd {
added: String,
},
FormatRemove {
removed: String,
},
FormatChange {
old_format: String,
new_format: String,
},
EnumAdd {
added: Value,
lhs_has_no_enum: bool,
},
EnumRemove {
removed: Value,
rhs_has_no_enum: bool,
},
PatternAdd {
added: String,
},
PatternRemove {
removed: String,
},
PatternChange {
old_pattern: String,
new_pattern: String,
},
MinLengthAdd {
added: u32,
},
MinLengthRemove {
removed: u32,
},
MinLengthChange {
old_value: u32,
new_value: u32,
},
MaxLengthAdd {
added: u32,
},
MaxLengthRemove {
removed: u32,
},
MaxLengthChange {
old_value: u32,
new_value: u32,
},
}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: JsonSchemaTypeThe type in question.
TypeRemove
A type has been removed and is no longer allowed.
Fields
removed: JsonSchemaTypeThe 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
FormatAdd
A format constraint has been added.
FormatRemove
A format constraint has been removed.
FormatChange
A format constraint has been changed.
EnumAdd
An enum value has been added to the allowed values.
Fields
EnumRemove
An enum value has been removed from the allowed values.
Fields
PatternAdd
A pattern constraint has been added.
PatternRemove
A pattern constraint has been removed.
PatternChange
A pattern constraint has been changed.
MinLengthAdd
A minLength constraint has been added.
MinLengthRemove
A minLength constraint has been removed.
MinLengthChange
A minLength constraint has been changed.
MaxLengthAdd
A maxLength constraint has been added.
MaxLengthRemove
A maxLength constraint has been removed.
MaxLengthChange
A maxLength constraint has been changed.
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.
Trait Implementations§
Source§impl Debug for ChangeKind
impl Debug for ChangeKind
Source§impl PartialEq for ChangeKind
impl PartialEq for ChangeKind
Source§fn eq(&self, other: &ChangeKind) -> bool
fn eq(&self, other: &ChangeKind) -> bool
self and other values to be equal, and is used by ==.