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

Support minValueInclusive #378

Open
nickevansuk opened this issue Mar 3, 2021 · 0 comments
Open

Support minValueInclusive #378

nickevansuk opened this issue Mar 3, 2021 · 0 comments
Assignees
Labels
rule A rule suggestion for implementation

Comments

@nickevansuk
Copy link
Contributor

nickevansuk commented Mar 3, 2021

See documentation here. This rule should target all fields, checking whether the field has minValueInclusive.

NOTE although the docs in the commit above state this rule should only apply to integers, it should in fact be applied to any JSON Number (updated in latest docs). This means it can be used to e.g. ensure that the decimal price is not negative. This rule will be useful for a number of fields, but the minValueInclusive property only been added to repeatCount in the data-models for now.

Note minValueInclusive will need to be added as a property to this class so that it is accessible:

const Field = class {

Rule as follows:

"minValueInclusive": 0

  • Checks that the value is a JSON Number that is not greater than the specified value, and outputs a FAILURE if not. If the value is not a JSON Number, no message is outputted (and a type error will likely be raised by another rule).
@nickevansuk nickevansuk added the rule A rule suggestion for implementation label Mar 3, 2021
@Lathrisk Lathrisk moved this from To do to In progress in Validator Work (ODSC) Mar 26, 2021
@Lathrisk Lathrisk self-assigned this Mar 26, 2021
@Lathrisk Lathrisk moved this from In progress to Done in Validator Work (ODSC) Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule A rule suggestion for implementation
Development

No branches or pull requests

2 participants