mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
A few tiny non breaking changes.
just cleaning things up, preparing for online demo push for https://pb33f.io
This commit is contained in:
@@ -173,7 +173,7 @@ func ExtractSpecInfo(spec []byte) (*SpecInfo, error) {
|
|||||||
if specVersion.SpecType == "" {
|
if specVersion.SpecType == "" {
|
||||||
// parse JSON
|
// parse JSON
|
||||||
parseJSON(spec, specVersion, &parsedSpec)
|
parseJSON(spec, specVersion, &parsedSpec)
|
||||||
specVersion.Error = errors.New("spec type not supported by vacuum, sorry")
|
specVersion.Error = errors.New("spec type not supported by libopenapi, sorry")
|
||||||
return specVersion, specVersion.Error
|
return specVersion, specVersion.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13
document.go
13
document.go
@@ -186,7 +186,12 @@ func CompareDocuments(original, updated Document) (*model.DocumentChanges, []err
|
|||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
errors = errs
|
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 {
|
if original.GetSpecInfo().SpecType == utils.OpenApi2 && updated.GetSpecInfo().SpecType == utils.OpenApi2 {
|
||||||
v2ModelLeft, errs := original.BuildV2Model()
|
v2ModelLeft, errs := original.BuildV2Model()
|
||||||
@@ -197,7 +202,11 @@ func CompareDocuments(original, updated Document) (*model.DocumentChanges, []err
|
|||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
errors = errs
|
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
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ var BinaryLabel = "binary"
|
|||||||
var ArrayLabel = "array"
|
var ArrayLabel = "array"
|
||||||
var BooleanLabel = "boolean"
|
var BooleanLabel = "boolean"
|
||||||
var SchemaSource = "https://json-schema.org/draft/2020-12/schema"
|
var SchemaSource = "https://json-schema.org/draft/2020-12/schema"
|
||||||
var SchemaId = "https://quobix.com/api/vacuum"
|
var SchemaId = "https://pb33f.io/openapi-changes/schema"
|
||||||
|
|
||||||
func MakeTagReadable(node *yaml.Node) string {
|
func MakeTagReadable(node *yaml.Node) string {
|
||||||
switch node.Tag {
|
switch node.Tag {
|
||||||
|
|||||||
Reference in New Issue
Block a user