diff --git a/schemas/imageFilterAttribute.schema.json b/schemas/imageFilterAttribute.schema.json new file mode 100644 index 0000000..dfc2c3c --- /dev/null +++ b/schemas/imageFilterAttribute.schema.json @@ -0,0 +1,158 @@ +{ + "$id":"https://raw.githubusercontent.com/SPINEProject/SPINE-json-schema/master/schemas/imageFilterAttribute.schema.json", + "$schema":"http://json-schema.org/draft-07/schema#", + "title":"Image filter attribute", + "type":"object", + "definitions": { + "attributeBase": { + "$id": "#attributeBase", + "description": "Attribute base schema", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "NUMBER", + "STRING" + ] + }, + "isOrdered": { + "type": "boolean" + }, + "attributeKey": { + "type": "string" + }, + "attributeLabel": { + "type": "string" + }, + "multiplicityMin": { + "type": "number", + "min": 1 + }, + "multiplicityMax": { + "oneOf": [ + { + "type": "number", + "min": 1 + }, + { + "type": "string", + "enum": [ + "N" + ] + } + ] + }, + "options": { + "type": "object", + "properties": { + "areOtherValuesAllowed": { + "type": "boolean" + }, + "enum": { + "type": "array" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + }, + "required": [ + "areOtherValuesAllowed" + ], + "additionalProperties": false + } + }, + "required": [ + "type", + "attributeKey", + "attributeLabel", + "multiplicityMin", + "multiplicityMax", + "options" + ], + "additionalProperties": false + }, + "attributeNumber": { + "$id": "#attributeNumber", + "description": "Attribute schema when atribute type is number", + "type": "object", + "allOf": [{ + "properties": { + "type": { + "type": "string", + "enum": [ + "NUMBER" + ] + }, + "options": { + "properties": { + "areOtherValuesAllowed": {}, + "enum": { + "items": { + "type": "number" + } + }, + "min": {}, + "max": {} + }, + "additionalProperties": false + } + }},{ + "$ref": "#/definitions/attributeBase" + }] + }, + "attributeString": { + "$id": "#attributeString", + "description": "Attribute schema when atribute type is string", + "type": "object", + "allOf": [ + { + "properties": { + "type": { + "type": "string", + "enum": [ + "STRING" + ] + }, + "options": { + "properties": { + "areOtherValuesAllowed": {}, + "enum": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + }, + { + "$ref": "#/definitions/attributeBase" + } + ] + }, + "attribute": { + "$id": "#attribute", + "description": "Attribute", + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/attributeNumber" + }, + { + "$ref": "#/definitions/attributeString" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/attribute" + } + ] +}