I am trying to implement this condition: a field is required based on the value of another field, that is, if a request with "index": "true" exists, then the element "id": true is required.
Here is an example circuit:
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "test title", "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/Item" }, "minItems": 0 } }, "required": [ "data" ], "definitions": { "Item": { "type": "object", "properties": { "id": { "type": [ "integer", "string" ] }, "type": { "type": "string" } } } } }
How can this be implemented?
Any pointers would be helpful.
source share