Multiple of a Number
Let's say you want to define a numeric property that should be a multiple of another number. We have added a new property, hourlyWage, in the JSON object.
1{ 2 "name":"John Doe", 3 "age": 25, 4 "hourlyWage": 10 5}
multipleOf Keyword
The multipleOf keyword is used to define a number which is a multiple of another number. The value of the multipleOf keyword must be a number, strictly greater than 0
Example
1{ 2 "type": "number", 3 "multipleOf": 5 4}
Now, try to modify the JSON schema given in the side editor such that hourlyWage property follows the given constraints.
Constraints
- hourlyWage should be a multiple of 0.25
- hourlyWage should have minimum value of 0 and maximum value of 100
Loading...
Output
Please click the button or use
Shift+Enter
to view the output