{ "title": "QED Object Schema", "type": "object", "oneOf": [ { "$ref": "#/schemaInfo" }, { "$ref": "#/docTypes/any" } ], "schemaInfo": { "type": "object", "properties": { "_id": { "type": "string", "pattern": "schemaInfo" }, "_rev": { "type": "string", "optional": true }, "version": { "type": "string", "pattern": "1" } }, "additionalProperties": false }, "docTypes": { "any": { "type": "object", "oneOf": [ { "$ref": "#/docTypes/Question" }, { "$ref": "#/docTypes/Survey" }, { "$ref": "#/docTypes/SurveyRun" }, { "$ref": "#/docTypes/Response" } ] }, "Question": { "properties": { "type": { "type": "string", "pattern": "Question" }, "_id": { "type": "string", "optional": true }, "_rev": { "type": "string", "optional": true }, "categories": { "type": "array", "items": { "type": "string" } }, "code": { "type": "string" }, "content": { "type": "array", "items": { "$ref": "#/contentTypes/any" } }, "description": { "type": "string", "optional": true }, "publicationDate": { "type": "string", "pattern": "", "optional": true }, "title": { "type": "string" }, "topic": { "type": "string", "optional": true } }, "additionalProperties": false }, "Survey": { "type": "object", "properties": { "type": { "type": "string", "pattern": "Survey" }, "_id": { "type": "string", "optional": true }, "_rev": { "type": "string", "optional": true }, "publicationDate": { "type": "string", "pattern": "", "optional": true }, "questions": { "type": "array", "items": { "$ref": "#/docTypes/Question" } }, "title": { "type": "string" } }, "additionalProperties": false }, "SurveyRun": { "type": "object", "properties": { "type": { "type": "string", "pattern": "SurveyRun" }, "_id": { "type": "string", "optional": true }, "_rev": { "type": "string", "optional": true }, "description": { "type": "string" }, "endDate": { "type": "string", "pattern": "" }, "mode": { "type": "string", "enum": [ "open", "closed" ] }, "startDate": { "type": "string", "pattern": "" }, "survey": { "$ref": "#/docTypes/Survey" }, "title": { "type": "string" } }, "additionalProperties": false }, "Response": { "type": "object", "properties": { "type": { "type": "string", "pattern": "Response" }, "_id": { "type": "string", "optional": true }, "_rev": { "type": "string", "optional": true }, "answers": { "type": "object" }, "publicationDate": { "type": "string", "pattern": "", "optional": true }, "surveyRunId": { "type": "string" } }, "additionalProperties": false } }, "contentTypes": { "any": { "type": "object", "oneOf": [ { "$ref": "#/contentTypes/Text" }, { "$ref": "#/contentTypes/StringInput" }, { "$ref": "#/contentTypes/ScaleInput" } ] }, "Text": { "type": "object", "properties": { "type": { "type": "string", "pattern": "Text" }, "text": { "type": "string" } }, "additionalProperties": false }, "StringInput": { "type": "object", "properties": { "type": { "type": "string", "pattern": "StringInput" }, "text": { "type": "string" } }, "additionalProperties": false }, "ScaleInput": { "type": "object", "properties": { "type": { "type": "string", "pattern": "ScaleInput" }, "minLabel": { "type": "string", "optional": true }, "min": { "type": "integer" }, "max": { "type": "integer" }, "maxLabel": { "type": "string", "optional": true }, "naLabel": { "type": "string", "optional": true }, "items": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string" }, "minLabel": { "type": "string", "optional": true }, "maxLabel": { "type": "string", "optional": true } }, "additionalProperties": false } } }, "additionalProperties": false } } }