Repository navigation
Conversation
is_int32 and is_int64 skipped the range check for anything that is not
an int. The OAS 3.1/3.2 type checker treats integral floats as integers,
so a JSON value such as 1e10 or 2147483648.0 passed
{type: integer, format: int32} while 10000000000 was rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
is_int32andis_int64only range-checkintinstances and returnTruefor anything else, floats included:1e10or2147483648.0passes{"type": "integer", "format": "int32"}while10000000000is rejected, and1e19passes int64 the same wayjson.loadsturns1e10into a float, so JSON bodies hit this directly: with openapi-core 0.23.1 and a 3.1 or 3.2 spec, a request body{"qty": 1e10}validates against an int32 field and reaches the handler as10000000000.0type: numberor untyped schemas with an int format, since its integer type check already rejects floatsFloats now go through the same comparison: in-range values (including
3.12, whichtest_formats_ignoredexpects to pass) are unchanged, and out-of-range values,infandnanare rejected.