Skip to content

Commit e691c86

Browse files
committed
fixes version determination
1 parent d87d38a commit e691c86

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

spaceapi_validator.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"errors"
66
"github.com/xeipuuv/gojsonschema"
7+
"strings"
78
)
89

910
//go:generate go run scripts/generate.go
@@ -37,7 +38,7 @@ func Validate(document string) (ValidationResult, error) {
3738
suppliedVersion := spaceApiVersion{}
3839
json.Unmarshal([]byte(document), &suppliedVersion)
3940

40-
schemaString, ok := SpaceApiSchemas[suppliedVersion.Api]
41+
schemaString, ok := SpaceApiSchemas[strings.Replace(suppliedVersion.Api, "0.", "", 1)]
4142
if !ok {
4243
schemaString = SpaceApiSchemas["13"]
4344
}

0 commit comments

Comments
 (0)