-
Notifications
You must be signed in to change notification settings - Fork 1
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
rules: core: Add minValueInclusive rule #389
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved assuming minor changes
tests: { | ||
belowMinimum: { | ||
description: 'Raises a failure if the value is below the associated minValueInclusive property.', | ||
message: 'The value of this property should be above or equal to {{minValueInclusive}}.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest slightly more conventional language here around "greater than".
message: 'The value of this property should be above or equal to {{minValueInclusive}}.', | |
message: 'The value of this property must be greater than or equal to {{minValueInclusive}}.', |
Also in general worth noting that within messages anything that results in a FAILURE must use the language "must", and anything that results in a WARNING must use the language "should". This is because "must" and "should" key words actually have defined interpretations (https://openactive.io/open-booking-api/EditorsDraft/1.0CR3/#conformance)
-100.1, | ||
-100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is best practice to test boundary conditions, so e.g.
-100.1, | |
-100, | |
-100.1, | |
-100, | |
-3.9, |
89.12345, | ||
89, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is best practice to test boundary conditions, so e.g.
89.12345, | |
89, | |
89.12345, | |
89, | |
4.1, |
@Lathrisk sorry just spotted this, should be:
anything that results in a FAILURE must use the language "must", and anything that results in a WARNING must use the language "should". This is because "must" and "should" key words actually have defined interpretations (https://openactive.io/open-booking-api/EditorsDraft/1.0CR3/#conformance) |
I'll put together an update shortly! |
#378
Adds a rule to check the values against minValueInclusive when it is supplied.