We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I noticed that there is a breaking change from 0.2.9 to 0.3.0, but I am not sure if it is intentional or not.
0.2.9
0.3.0
tl;dr: an integer is no longer considered a valid (default) value for a double. In the example below, 15 fails the validation, but 15.0 is fine.
15
15.0
PS: I am using openapi-spec-validator through the connexion library.
openapi-spec-validator
python -m venv .venv source .venv/bin/activate pip install "[email protected]"
>>> from openapi_spec_validator import validate_spec >>> from openapi_spec_validator.readers import read_from_filename >>> >>> spec_dict, spec_url = read_from_filename('./openapi.yaml') >>> validate_spec(spec_dict) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<current working directory>/.venv/lib/python3.9/site-packages/openapi_spec_validator/shortcuts.py", line 7, in validate return validator_callable(spec, spec_url=spec_url) File "<current working directory>/__app__/.venv/lib/python3.9/site-packages/openapi_spec_validator/validators.py", line 48, in validate raise err openapi_spec_validator.exceptions.OpenAPIValidationError: 15 is not a 'double' Failed validating 'format' in schema: {'default': 15, 'format': 'double', 'maximum': 60, 'minimum': 15, 'nullable': False, 'type': 'number'} On instance: 15
where openapi.yaml is defined as
openapi: "3.0.3" info: title: API version: "1.0.0" servers: - url: http://localhost/api description: Used for local development. paths: /foo: get: parameters: - in: query name: duration required: false schema: type: number format: double default: 15 maximum: 60 minimum: 15 example: 53 responses: 200: description: "" content: text/plain: {}
Changing default: 15 to default: 15.0 works as expected.
default: 15
default: 15.0
In version 0.2.9, the OpenAPI specification above was considered valid.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I noticed that there is a breaking change from
0.2.9
to0.3.0
, but I am not sure if it is intentional or not.tl;dr: an integer is no longer considered a valid (default) value for a double. In the example below,
15
fails the validation, but15.0
is fine.PS: I am using
openapi-spec-validator
through the connexion library.Steps to reproduce
where openapi.yaml is defined as
Changing
default: 15
todefault: 15.0
works as expected.In version
0.2.9
, the OpenAPI specification above was considered valid.The text was updated successfully, but these errors were encountered: