Skip to content
New issue

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

Generate correct "type" for Integer fields #118

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SteadBytes
Copy link

Closes #117

Using a type of number and a format of integer is not documented in the JSON schema specification as a correct way to represent integers. Instead, a type of integer should be used as this ensure that validators will correctly validate inputs as an integer and not accept
number values.

This is a breaking change as there is potential for previous successful validations to fail if users are validating number (e.g. floats) values against integer fields.

Using a "type" of "number" and a "format" of "integer" is not documented
in the JSON schema specification as a correct way to represent integers.
Instead, a "type" of "integer" should be used as this ensure that
validators will correctly validate inputs as an integer and not accept
"number" values.

https://json-schema.org/understanding-json-schema/reference/numeric.html?highlight=integer#integer

Signed-off-by: Ben Steadman <steadmanben1@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling c7518dc on SteadBytes:117-integer-type into 81f08af on fuhrysteve:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect integer type
3 participants