Tests were hanging, stopped JSON parsing channel use altogether

vacuum will need looking at for this later version.
This commit is contained in:
Dave Shanley
2022-12-13 14:09:15 -05:00
parent 724fdb31c4
commit ece888d201
3 changed files with 2 additions and 22 deletions

View File

@@ -105,8 +105,7 @@ func ExtractSpecInfo(spec []byte) (*SpecInfo, error) {
spec.SpecJSONBytes = &bytes
spec.SpecJSON = &jsonSpec
}
spec.JsonParsingChannel <- true
close(spec.JsonParsingChannel)
close(spec.JsonParsingChannel) // this needs removing at some point
}
// check for specific keys
@@ -129,8 +128,6 @@ func ExtractSpecInfo(spec []byte) (*SpecInfo, error) {
specVersion.SpecFormat = OAS3
}
//return specVersion, nil
if openAPI2 != nil {
specVersion.SpecType = utils.OpenApi2
version, majorVersion, versionError := parseVersionTypeData(openAPI2.Value)
@@ -172,10 +169,10 @@ func ExtractSpecInfo(spec []byte) (*SpecInfo, error) {
if specVersion.SpecType == "" {
// parse JSON
parseJSON(spec, specVersion, &parsedSpec)
specVersion.Error = errors.New("spec type not supported by vacuum, sorry")
return specVersion, specVersion.Error
}
return specVersion, nil
}