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

Add support for integer formats int32 and int64 #56

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

Add support for integer formats int32 and int64 #56

wants to merge 2 commits into from

Conversation

mdvorak
Copy link

@mdvorak mdvorak commented Jul 4, 2018

Limit range of generated numbers for these integer subtypes.

They are well known by OpenAPI: https://swagger.io/docs/specification/data-models/data-types/#numbers

Note Number has larger absolute range than int64, but numbers outside MAX_SAFE_INTEGER and MIN_SAFE_INTEGER range are rounded. To avoid wierd behavior, I've set limits for int64 to these SAFE constraints.

I've added asserts to tests, but since numbers are random-generated, they are not really conclusive.. I've ran tests 100 times to make sure its likely correct.

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.

2 participants