mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 12:37:48 +00:00
Building out schema comparison mechanism
Which has led to a new wider hashing capability for the low level API. hashing makes it very easy to determine changes quickly, without having to run comparisons to discover changes, could really speed things up moving forward.
This commit is contained in:
@@ -161,7 +161,11 @@ func CheckForAddition[T any](l, r *yaml.Node, label string, changes *[]*Change[T
|
||||
//
|
||||
// The Change is then added to the slice of []Change[T] instances provided as a pointer.
|
||||
func CheckForModification[T any](l, r *yaml.Node, label string, changes *[]*Change[T], breaking bool, orig, new T) {
|
||||
if l != nil && l.Value != "" && r != nil && r.Value != "" && r.Value != l.Value {
|
||||
if l != nil && l.Value != "" && r != nil && r.Value != "" && r.Value != l.Value && r.Tag == l.Tag {
|
||||
CreateChange[T](changes, Modified, label, l, r, breaking, orig, new)
|
||||
}
|
||||
// the values may have not changed, but the tag (node type) type may have
|
||||
if l != nil && l.Value != "" && r != nil && r.Value != "" && r.Value != l.Value && r.Tag != l.Tag {
|
||||
CreateChange[T](changes, Modified, label, l, r, breaking, orig, new)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user