Closed metadatadriven closed 1 year ago
The regex that openapi.go (line 29) used to determine whether a spec is openapi 3 fails for some valid files, for example:
{ "openapi" : "3.0.0", "info" : { "title" : "Library API", "description" : "REST API documentation for production server", "version" : "3.0", "contact" : { "name" : "Library Support", "email" : "foo@bar.org" },
Which fails because of the space between the colon which is not defined in the regex:
// reOpenAPI3 is a regex used to detect OpenAPI files from their contents. var reOpenAPI3 = regexp.MustCompile(`['"]?openapi['"]?:\s*['"]?3`)
The regexp should be:
// reOpenAPI3 is a regex used to detect OpenAPI files from their contents. var reOpenAPI3 = regexp.MustCompile(`['"]?openapi['"]?\s*:\s*['"]?3`)
Closing as #198 was merged. Release is coming within the next few days.
The regex that openapi.go (line 29) used to determine whether a spec is openapi 3 fails for some valid files, for example:
Which fails because of the space between the colon which is not defined in the regex:
The regexp should be: