Skip to content

Commit

Permalink
Fixing anno support
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed Dec 12, 2019
1 parent 63df9ab commit 8f94de2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 42 deletions.
32 changes: 2 additions & 30 deletions schema/iiif_3_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,44 +759,16 @@
"format": "uri",
"pattern": "^http.*$"
},
{
"$ref": "#/classes/pointSelector"
},
{
"type": "object",
"properties": {
"oneOf": [
{
"type": {
"type": "string",
"pattern": "^FragmentSelector$"
}
},
{
"type": {
"type": "string",
"pattern": "^SvgSelector$"
}
}
]
"type": { "type": "string" },
"t": { "$ref": "#/types/duration" }
},
"required": ["type"]
}
]
},
"pointSelector": {
"type": "object",
"properties": {
"type": {
"type": "string",
"pattern": "^PointSelector$"
},
"x": { "type": "integer" },
"y": { "type": "integer" },
"t": { "$ref": "#/types/duration" }
},
"required": ["type"]
},
"range": {
"allOf": [
{ "$ref": "#/types/class" },
Expand Down
23 changes: 11 additions & 12 deletions schema/schemavalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@ def validate(data, version, url):
errors = errors[0].context
for err in errors:
if 'is not valid under any of the given schemas' in err.message:
continue
#subErrorMessages = []
#for subErr in err.context:
# if 'is not valid under any of the given schemas' not in subErr.message:
# subErrorMessages.append(subErr.message)
#errorsJson.append({
# 'title': 'Error {} of {}.\n Message: Failed to process submission due too many errors'.format(errorCount, len(errors)),
# 'detail': 'This error is likely due to other listed errors. Fix those errors first.',
# 'description': "{}".format(subErrorMessages),
# 'path': '',
# 'context': ''
#})
subErrorMessages = []
for subErr in err.context:
if 'is not valid under any of the given schemas' not in subErr.message:
subErrorMessages.append(subErr.message)
errorsJson.append({
'title': 'Error {} of {}.\n Message: Failed to process submission due too many errors'.format(errorCount, len(errors)),
'detail': 'This error is likely due to other listed errors. Fix those errors first.',
'description': "{}".format(subErrorMessages),
'path': '',
'context': ''
})

else:
detail = ''
Expand Down

0 comments on commit 8f94de2

Please sign in to comment.