Ignore:
Timestamp:
03/12/14 02:23:11 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Server handles the new flat response format correctly.
  • Client widgets and survey rendering creates a flat structure.
  • Fixed logic error in checking if questions in survey are published.
  • Restrict accepted properties in answers and reject empty strings as properties.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/server/config/couchdb-schema.json

    r506 r508  
    22  "$schema": "http://json-schema.org/draft-04/schema#",
    33  "title": "QED Object Schema",
    4   "version": "3",
     4  "version": "4",
    55  "type": "object",
    66  "oneOf": [
     
    1010  "definitions": {
    1111    "nonEmptyString": { "type": "string", "minLength": 1 },
     12    "codeString": { "type": "string", "pattern": "^[A-Za-z0-9]+$" },
    1213    "schemaInfo": {
    1314      "type": "object",
     
    3738          "_rev": { "$ref": "#/definitions/nonEmptyString" },
    3839          "categories": { "type": "array", "items": { "$ref": "#/definitions/nonEmptyString" } },
    39           "code": { "$ref": "#/definitions/nonEmptyString" },
     40          "code": { "$ref": "#/definitions/codeString" },
    4041          "content": { "type": "array", "items": { "$ref": "#/definitions/content/any" } },
    4142          "description": { "$ref": "#/definitions/nonEmptyString" },
     
    8687          "_id": { "$ref": "#/definitions/nonEmptyString" },
    8788          "_rev": { "$ref": "#/definitions/nonEmptyString" },
    88           "answers": { "type": "object" },
     89          "answers": {
     90              "type": "object",
     91              "patternProperties": {
     92                  "^[A-Za-z0-9]+$": {}
     93              },
     94              "additionalProperties": false
     95          },
    8996          "email": { "type": "string", "format": "email" },
    9097          "publicationDate": { "type": "string", "format": "datetime" },
     
    139146        "properties": {
    140147          "type": { "type": "string", "pattern": "^StringInput$" },
    141           "subcode": { "$ref": "#/definitions/nonEmptyString" },
     148          "subcode": { "$ref": "#/definitions/codeString" },
    142149          "text": { "$ref": "#/definitions/nonEmptyString" }
    143150        },
     
    150157          "type": { "type": "string", "pattern": "^TextInput$" },
    151158          "maxLength": { "type": "integer" },
    152           "subcode": { "$ref": "#/definitions/nonEmptyString" },
     159          "subcode": { "$ref": "#/definitions/codeString" },
    153160          "text": { "$ref": "#/definitions/nonEmptyString" }
    154161        },
     
    163170          "max": { "type": "integer" },
    164171          "places": { "type": "integer" },
    165           "subcode": { "$ref": "#/definitions/nonEmptyString" },
     172          "subcode": { "$ref": "#/definitions/codeString" },
    166173          "text": { "$ref": "#/definitions/nonEmptyString" }
    167174        },
     
    183190              "minLabel": { "$ref": "#/definitions/nonEmptyString" },
    184191              "maxLabel": { "$ref": "#/definitions/nonEmptyString" },
    185               "subcode": { "$ref": "#/definitions/nonEmptyString" },
     192              "subcode": { "$ref": "#/definitions/codeString" },
    186193              "text": { "$ref": "#/definitions/nonEmptyString" }
    187194            },
     
    201208              "type": "object",
    202209              "properties": {
    203                   "subcode": { "$ref": "#/definitions/nonEmptyString" },
     210                  "subcode": { "$ref": "#/definitions/codeString" },
    204211                  "text": { "$ref": "#/definitions/nonEmptyString" }
    205212              },
     
    210217              "type": "object",
    211218              "properties": {
    212                   "subcode": { "$ref": "#/definitions/nonEmptyString" },
     219                  "subcode": { "$ref": "#/definitions/codeString" },
    213220                  "text": { "$ref": "#/definitions/nonEmptyString" }
    214221              },
Note: See TracChangeset for help on using the changeset viewer.