[479] | 1 | { |
---|
[487] | 2 | "$schema": "http://json-schema.org/draft-04/schema#", |
---|
[479] | 3 | "title": "QED Object Schema", |
---|
[487] | 4 | "version": "2", |
---|
[480] | 5 | "type": "object", |
---|
| 6 | "oneOf": [ |
---|
[487] | 7 | { "$ref": "#/definitions/schemaInfo" }, |
---|
| 8 | { "$ref": "#/definitions/docs/any" } |
---|
[480] | 9 | ], |
---|
[487] | 10 | "definitions": { |
---|
| 11 | "schemaInfo": { |
---|
[479] | 12 | "type": "object", |
---|
| 13 | "properties": { |
---|
[487] | 14 | "_id": { "type": "string", "pattern": "schemaInfo" }, |
---|
| 15 | "_rev": { "type": "string" }, |
---|
| 16 | "version": { "type": "string" } |
---|
[479] | 17 | }, |
---|
[487] | 18 | "required": ["_id","version"], |
---|
[479] | 19 | "additionalProperties": false |
---|
| 20 | }, |
---|
[487] | 21 | "docs": { |
---|
| 22 | "any": { |
---|
| 23 | "type": "object", |
---|
| 24 | "oneOf":[ |
---|
| 25 | { "$ref": "#/definitions/docs/Question" }, |
---|
| 26 | { "$ref": "#/definitions/docs/Survey" }, |
---|
| 27 | { "$ref": "#/definitions/docs/SurveyRun" }, |
---|
| 28 | { "$ref": "#/definitions/docs/Response" } |
---|
| 29 | ] |
---|
[479] | 30 | }, |
---|
[487] | 31 | "Question": { |
---|
| 32 | "type": "object", |
---|
| 33 | "properties": { |
---|
| 34 | "type": { "type": "string", "pattern": "Question" }, |
---|
| 35 | "_id": { "type": "string" }, |
---|
| 36 | "_rev": { "type": "string" }, |
---|
| 37 | "categories": { "type": "array", "items": { "type": "string" } }, |
---|
| 38 | "code": { "type": "string" }, |
---|
| 39 | "content": { "type": "array", "items": { "$ref": "#/definitions/content/any" } }, |
---|
| 40 | "description": { "type": "string" }, |
---|
| 41 | "publicationDate": { "type": "string", "format": "datetime" }, |
---|
| 42 | "title": { "type": "string" }, |
---|
| 43 | "topic": { "type": "string" } |
---|
| 44 | }, |
---|
| 45 | "required": ["type","categories","code","content","title"], |
---|
| 46 | "additionalProperties": false |
---|
[479] | 47 | }, |
---|
[487] | 48 | "Survey": { |
---|
| 49 | "type": "object", |
---|
| 50 | "properties": { |
---|
| 51 | "type": { "type": "string", "pattern": "Survey" }, |
---|
| 52 | "_id": { "type": "string" }, |
---|
| 53 | "_rev": { "type": "string" }, |
---|
| 54 | "publicationDate": { "type": "string", "format": "datetime" }, |
---|
| 55 | "questions": { "type": "array", "items": { "$ref": "#/definitions/docs/Question" } }, |
---|
| 56 | "title": { "type": "string" } |
---|
| 57 | }, |
---|
| 58 | "required": ["type","questions","title"], |
---|
| 59 | "additionalProperties": false |
---|
[479] | 60 | }, |
---|
[487] | 61 | "SurveyRun": { |
---|
[479] | 62 | "type": "object", |
---|
| 63 | "properties": { |
---|
[487] | 64 | "type": { "type": "string", "pattern": "SurveyRun" }, |
---|
| 65 | "_id": { "type": "string" }, |
---|
| 66 | "_rev": { "type": "string" }, |
---|
| 67 | "description": { "type": "string" }, |
---|
| 68 | "endDate": { "type": "string", "format": "datetime" }, |
---|
| 69 | "mode": { "type": "string", "enum": [ "open", "closed" ] }, |
---|
| 70 | "secret": { "type": "string", "minLength": 8 }, |
---|
| 71 | "startDate": { "type": "string", "format": "datetime" }, |
---|
| 72 | "survey": { "$ref": "#/definitions/docs/Survey" }, |
---|
| 73 | "title": { "type": "string" } |
---|
[479] | 74 | }, |
---|
[487] | 75 | "required": ["type","description","mode","secret","survey","title"], |
---|
[479] | 76 | "additionalProperties": false |
---|
[487] | 77 | }, |
---|
| 78 | "Response": { |
---|
[479] | 79 | "type": "object", |
---|
| 80 | "properties": { |
---|
[487] | 81 | "type": { "type": "string", "pattern": "Response" }, |
---|
| 82 | "_id": { "type": "string" }, |
---|
| 83 | "_rev": { "type": "string" }, |
---|
| 84 | "answers": { "type": "object" }, |
---|
| 85 | "publicationDate": { "type": "string", "format": "datetime" }, |
---|
| 86 | "secret": { "type": "string", "minLength": 8 }, |
---|
| 87 | "surveyRunId": { "type": "string" } |
---|
[479] | 88 | }, |
---|
[487] | 89 | "required": ["type","answers","secret","surveyRunId"], |
---|
[479] | 90 | "additionalProperties": false |
---|
[487] | 91 | } |
---|
[479] | 92 | }, |
---|
[487] | 93 | "content":{ |
---|
| 94 | "any": { |
---|
[479] | 95 | "type": "object", |
---|
[487] | 96 | "oneOf": [ |
---|
| 97 | { "$ref": "#/definitions/content/Text" }, |
---|
| 98 | { "$ref": "#/definitions/content/StringInput" }, |
---|
| 99 | { "$ref": "#/definitions/content/ScaleInput" } |
---|
| 100 | ] |
---|
| 101 | }, |
---|
| 102 | "Text": { |
---|
| 103 | "type": "object", |
---|
[479] | 104 | "properties": { |
---|
[487] | 105 | "type": { "type": "string", "pattern": "Text" }, |
---|
| 106 | "text": { "type": "string" } |
---|
[479] | 107 | }, |
---|
[487] | 108 | "required": ["type","text"], |
---|
[479] | 109 | "additionalProperties": false |
---|
[487] | 110 | }, |
---|
| 111 | "StringInput": { |
---|
| 112 | "type": "object", |
---|
| 113 | "properties": { |
---|
| 114 | "type": { "type": "string", "pattern": "StringInput" }, |
---|
| 115 | "text": { "type": "string" } |
---|
| 116 | }, |
---|
| 117 | "required":["type","text"], |
---|
| 118 | "additionalProperties": false |
---|
| 119 | }, |
---|
| 120 | "ScaleInput": { |
---|
| 121 | "type": "object", |
---|
| 122 | "properties": { |
---|
| 123 | "type": { "type": "string", "pattern": "ScaleInput" }, |
---|
| 124 | "minLabel": { "type": "string" }, |
---|
| 125 | "min": { "type": "integer" }, |
---|
| 126 | "max": { "type": "integer" }, |
---|
| 127 | "maxLabel": { "type": "string" }, |
---|
| 128 | "naLabel": { "type": "string" }, |
---|
| 129 | "items": { "type": "array", "items": { |
---|
| 130 | "type": "object", |
---|
| 131 | "properties": { |
---|
| 132 | "text": { "type": "string" }, |
---|
| 133 | "minLabel": { "type": "string" }, |
---|
| 134 | "maxLabel": { "type": "string" } |
---|
| 135 | }, |
---|
| 136 | "required":["text"], |
---|
| 137 | "additionalProperties": false |
---|
| 138 | } } |
---|
| 139 | }, |
---|
| 140 | "required":["type","min","max","items"], |
---|
| 141 | "additionalProperties": false |
---|
| 142 | } |
---|
[479] | 143 | } |
---|
| 144 | } |
---|
| 145 | } |
---|