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:
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).
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
priceis not negative. This rule will be useful for a number of fields, but theminValueInclusiveproperty only been added torepeatCountin thedata-modelsfor now.Note
minValueInclusivewill need to be added as a property to this class so that it is accessible:data-model-validator/src/classes/field.js
Line 4 in 652c8d9
Rule as follows:
"minValueInclusive": 0