use crate::JsonPathStack;
#[derive(Debug)]
pub struct Change {
pub message: String,
pub old_path: JsonPathStack,
pub new_path: JsonPathStack,
pub comparison: ChangeComparison,
pub class: ChangeClass,
pub details: ChangeDetails,
}
impl Change {
pub fn new(
message: impl ToString,
old_path: JsonPathStack,
new_path: JsonPathStack,
comparison: ChangeComparison,
class: ChangeClass,
details: ChangeDetails,
) -> Self {
Self {
message: message.to_string(),
old_path,
new_path,
comparison,
class,
details,
}
}
}
#[derive(Debug)]
pub enum ChangeComparison {
Input,
Output,
Structural,
}
#[derive(Debug)]
pub enum ChangeClass {
BackwardIncompatible,
ForwardIncompatible,
Incompatible,
Trivial,
Unhandled,
}
#[derive(Debug)]
pub enum ChangeDetails {
Metadata,
Added,
Removed,
AddedRequired,
MoreStrict,
LessStrict,
Datatype,
UnknownDifference,
}