mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
Couple of small fixes for what-changed.
No breaking changes, errors and model are returned now (allows errors and model through). And a small fix to the paths hashing mechanism to ensure identical paths with different names are checked.
This commit is contained in:
10
document.go
10
document.go
@@ -182,10 +182,7 @@ func CompareDocuments(original, updated Document) (*model.DocumentChanges, []err
|
||||
if len(errs) > 0 {
|
||||
errors = errs
|
||||
}
|
||||
if len(errors) > 0 {
|
||||
return nil, errors
|
||||
}
|
||||
return what_changed.CompareOpenAPIDocuments(v3ModelLeft.Model.GoLow(), v3ModelRight.Model.GoLow()), nil
|
||||
return what_changed.CompareOpenAPIDocuments(v3ModelLeft.Model.GoLow(), v3ModelRight.Model.GoLow()), errors
|
||||
}
|
||||
if original.GetSpecInfo().SpecType == utils.OpenApi2 && updated.GetSpecInfo().SpecType == utils.OpenApi2 {
|
||||
v2ModelLeft, errs := original.BuildV2Model()
|
||||
@@ -196,10 +193,7 @@ func CompareDocuments(original, updated Document) (*model.DocumentChanges, []err
|
||||
if len(errs) > 0 {
|
||||
errors = errs
|
||||
}
|
||||
if len(errors) > 0 {
|
||||
return nil, errors
|
||||
}
|
||||
return what_changed.CompareSwaggerDocuments(v2ModelLeft.Model.GoLow(), v2ModelRight.Model.GoLow()), nil
|
||||
return what_changed.CompareSwaggerDocuments(v2ModelLeft.Model.GoLow(), v2ModelRight.Model.GoLow()), errors
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user