A few tiny non breaking changes.

just cleaning things up, preparing for online demo push for https://pb33f.io
This commit is contained in:
Dave Shanley
2023-02-11 09:14:18 -05:00
parent 545dbc88c4
commit 2d536c884d
3 changed files with 13 additions and 4 deletions

View File

@@ -186,7 +186,12 @@ func CompareDocuments(original, updated Document) (*model.DocumentChanges, []err
if len(errs) > 0 {
errors = errs
}
return what_changed.CompareOpenAPIDocuments(v3ModelLeft.Model.GoLow(), v3ModelRight.Model.GoLow()), errors
if v3ModelLeft != nil && v3ModelRight != nil {
return what_changed.CompareOpenAPIDocuments(v3ModelLeft.Model.GoLow(), v3ModelRight.Model.GoLow()), errors
} else {
return nil, errs
}
}
if original.GetSpecInfo().SpecType == utils.OpenApi2 && updated.GetSpecInfo().SpecType == utils.OpenApi2 {
v2ModelLeft, errs := original.BuildV2Model()
@@ -197,7 +202,11 @@ func CompareDocuments(original, updated Document) (*model.DocumentChanges, []err
if len(errs) > 0 {
errors = errs
}
return what_changed.CompareSwaggerDocuments(v2ModelLeft.Model.GoLow(), v2ModelRight.Model.GoLow()), errors
if v2ModelLeft != nil && v2ModelRight != nil {
return what_changed.CompareSwaggerDocuments(v2ModelLeft.Model.GoLow(), v2ModelRight.Model.GoLow()), errors
} else {
return nil, errs
}
}
return nil, nil
}