Enum json_schema_diff::ChangeKind
source · pub enum ChangeKind {
TypeAdd {
added: JsonSchemaType,
},
TypeRemove {
removed: JsonSchemaType,
},
PropertyAdd {
lhs_additional_properties: bool,
added: String,
},
PropertyRemove {
lhs_additional_properties: bool,
removed: String,
},
RangeAdd {
added: Range,
value: f64,
},
RangeRemove {
removed: Range,
value: f64,
},
RangeChange {
changed: Range,
old_value: f64,
new_value: f64,
},
TupleToArray {
old_length: usize,
},
ArrayToTuple {
new_length: usize,
},
TupleChange {
new_length: usize,
},
}
Expand description
The kind of change + data relevant to the change.
Variants§
TypeAdd
Fields
added: JsonSchemaType
The type in question.
A type has been added and is now additionally allowed.
TypeRemove
Fields
removed: JsonSchemaType
The type in question.
A type has been removed and is no longer allowed.
PropertyAdd
Fields
A property has been added and (depending on additionalProperties) is now additionally allowed.
PropertyRemove
Fields
A property has been removed and (depending on additionalProperties) might now no longer be allowed.
RangeAdd
A minimum/maximum constraint has been added.
RangeRemove
Fields
A minimum/maximum constraint has been removed.
RangeChange
Fields
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.
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<ChangeKind> for ChangeKind
impl PartialEq<ChangeKind> 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 ==
.