APIDevTools / swagger-parser

Swagger 2.0 and OpenAPI 3.0 parser/validator
https://apitools.dev/swagger-parser
MIT License
1.08k stars 153 forks source link

swagger version field as 'number' type is not detected in one case #226

Closed nathcarmona closed 1 year ago

nathcarmona commented 1 year ago

I have noticed that the validator does not check for the type of "version" in a swagger file when it has major, minor and patch versions.

info:
  title: Swagger Petstore - OpenAPI 3.0
  version: 1.0.0

When the version is of type number and version: 1.0 or version: 1, an error is thrown "API version number must a string (e.g. "1.0.0") not a number", but the error does not appear when version: 1.0.0.

philsturgeon commented 1 year ago

Thats thanks to YAML considering that a string. 🙌🏻