I'm trying to validate a json schema based on the relation between two elements of the json object.
According to the draft of JSON Schema: to validate elements a json with inter-depedant keywords:
4.2. Inter-dependent keywords
In order to validate an instance, some keywords are influenced by the presence (or absence) of other keywords. In this case, all these keywords will be grouped in the same section.
http://json-schema.org/latest/json-schema-validation.html#anchor9
My problem is that the draft, doesn't really say how to write the schema in order to provide that validation. What I need to do, is validate a json like this:
{ a: 1, b: 2}
When a is always lower or equal to b. Can this be done? How do I write the schema?
Thanks