Skip to content

Commit

Permalink
Moving to cascading if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed Mar 9, 2023
1 parent 9c074fc commit 45bf97c
Showing 1 changed file with 35 additions and 39 deletions.
74 changes: 35 additions & 39 deletions schema/iiif_3_0.json
Expand Up @@ -194,48 +194,44 @@
"required": ["type", "items"]
},
"resource": {
"allOf": [
{
"title": "ContentResource",
"if": {
"type": "object",
"properties": {
"type": { "const": "TextualBody" }
}
"title": "ContentResource",
"if": {
"type": "object",
"properties": {
"type": { "const": "TextualBody" }
}
},
"then": {
"title": "Annotation bodies which are TextualBody MUST have an type and value property.",
"type": "object",
"properties": {
"id": { "$ref": "#/types/id" },
"type": {
"type": "string",
"pattern": "^TextualBody$",
"default": "TextualBody"
},
"then": {
"title": "Annotation bodies which are TextualBody MUST have an type and value property.",
"type": "object",
"properties": {
"id": { "$ref": "#/types/id" },
"type": {
"type": "string",
"pattern": "^TextualBody$",
"default": "TextualBody"
},
"value": { "type": "string" },
"format": { "$ref": "#/types/format" },
"language": { "type": "string"}
},
"required": ["value", "type"]
}
"value": { "type": "string" },
"format": { "$ref": "#/types/format" },
"language": { "type": "string"}
},
{
"required": ["value", "type"]
},
"else": {
"if": {
"type":"object",
"properties": {
"type": {
"type": "string",
"const": "SpecificResource"
}
}
},
"then": {
"title": "SpecificResource",
"if": {
"type":"object",
"properties": {
"type": {
"type": "string",
"const": "SpecificResource"
}
}
},
"then": {
"$ref": "#/classes/specificResource"
}
"$ref": "#/classes/specificResource"
},
{
"else": {
"title": "ContentResource: (not a TextualBody): ",
"description": "Annotation bodies MUST have an id and type property.",
"type": "object",
Expand All @@ -260,7 +256,7 @@
},
"required": ["id", "type"]
}
]
}
},
"imgSvr": {
"allOf": [
Expand Down

0 comments on commit 45bf97c

Please sign in to comment.