open-api
open-api copied to clipboard
Validator: Default to version from schema
OpenAPI/Swagger schemas can define their version in the schema, so the validator can use that in the absence of the version argument:
{"openapi": "3.0.1"}
{"swagger": "2.0"}
Also related, I think the current integer version argument should also accept string, e.g. the OpenAPI 3.1.0 will have to validate differently than 3.0.1 for example.
@silverwind can you submit a pr for this?
For the default value, possibly. It would coerce the version to the first digit of the string in the spec, if present. Long-term and once 3.1.0 is supported, the option format will have to change to string I guess.