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 validateMaximum & validateMinimum #3703

Merged
merged 5 commits into from Sep 29, 2017
Merged

Add validateMaximum & validateMinimum #3703

merged 5 commits into from Sep 29, 2017

Conversation

heldersepu
Copy link
Contributor

This address some of the validation requested on Issue #993

This address some of the validation requested on Issue #993
if (err) errors.push(err)
}

if (minimum) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this handle negative minimum values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure it will, what makes you think it won't?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought for a second that negative integers would evaluate as false, but I was wrong. The only number that does is 0.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test to verify!

heldersepu and others added 2 commits September 24, 2017 15:45
Testing valid negative number with min and max
Copy link
Contributor

@shockey shockey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good (thanks for the tests!), except that minimum: 0 and maximum: 0 do not trigger validation.

I'll make these changes now.

@shockey shockey merged commit e0fb125 into swagger-api:master Sep 29, 2017
@shockey
Copy link
Contributor

shockey commented Sep 29, 2017

Thanks @heldersepu!

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.

None yet

3 participants