Created
August 4, 2014 11:40
-
-
Save freetonik/daa3220720ecf0e7da6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "http://json-schema.org/draft-04/schema#", | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"description": "Quiz schema", | |
"type": "object", | |
"properties": { | |
"items": { | |
"type": "object", | |
"patternProperties": { | |
"[A-Za-z0-9_-]" : { | |
"oneOf" : [ | |
{ | |
"type": "object", | |
"required": ["question", "correct_answers", "answers"], | |
"properties": { | |
"question": { | |
"type": "string" | |
}, | |
"correct_answers": { | |
"type": "array", | |
"minItems": 1, | |
"items": { | |
"type": "string" | |
}, | |
"uniqueItems": true | |
}, | |
"answers": { | |
"type": "array", | |
"minItems": 1, | |
"items": { | |
"type": "string" | |
}, | |
"uniqueItems": true | |
} | |
} | |
}, | |
{ | |
"type": "object", | |
"required": ["question", "correct_answers", "text"], | |
"properties": { | |
"question": { | |
"type": "string" | |
}, | |
"text": { | |
"type": "string", | |
"pattern": "(.*{[\\w_]+})+" | |
}, | |
"correct_answers": { | |
"type": "object", | |
"patternProperties": { | |
"[A-Za-z0-9_-]" : { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment