Changeset 506 for Dev


Ignore:
Timestamp:
03/11/14 22:45:58 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Added subcodes to schema and config widgets.
  • Disallow empty strings in schema and strip objects before sending them to the server.
  • Finally managed proper change events in lists and complexvalues.
Location:
Dev/trunk/src
Files:
1 added
2 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/css/model/widgets/ScaleWidget.less

    r443 r506  
    33        text-align: center;
    44    }
    5     th { font-weight: normal; }
     5    th {
     6        font-weight: normal;
     7    }
     8    .subcode {
     9        .dijitTextBox {
     10            width: 4em;
     11        }
     12    }
    613    .item {
    714        text-align: left;
     
    916        max-width: 15em;
    1017    }
    11     .min { text-align: right; padding-left: 2em; }
    12     .max { text-align: left;  padding-right: 2em; }
    13     .na { text-align: center; }
     18    .minLabel {
     19        text-align: right;
     20        padding-left: 2em;
     21    }
     22    .min {
     23        .dijitTextBox {
     24            width: 4em;
     25        }
     26    }
     27    .max {
     28        .dijitTextBox {
     29            width: 4em;
     30        }
     31    }
     32    .maxLabel {
     33        text-align: left;
     34        padding-right: 2em;
     35    }
     36    .na {
     37        text-align: center;
     38    }
    1439
    1540    .dijitTextBox {
  • Dev/trunk/src/client/qed-client/css/qed.less

    r494 r506  
    3232@import "widgets/LineWithActions.less";
    3333@import "model/widgets/ScaleWidget.less";
     34@import "model/widgets/MultipleChoiceWidget.less";
    3435@import "model/widgets/QuestionListView.less";
    3536@import "model/widgets/QuestionEditor.less";
  • Dev/trunk/src/client/qed-client/model/classes/_Class.js

    r493 r506  
    11define([
    22    "./_View",
     3    "dojo/_base/array",
    34    "dojo/_base/declare",
    45    "dojo/_base/lang",
    56    "dojo/date/stamp"
    6 ], function(_View, declare, lang, stamp) {
     7], function(_View, array, declare, lang, stamp) {
    78
    89    var _Class = declare([_View],{
     
    2223        _doSerialize: function(obj) {
    2324            obj = lang.clone(obj);
    24             return this._serialize(obj) || obj;
     25            obj = this._serialize(obj) || obj;
     26            this._strip(obj);
     27            return obj;
    2528        },
    2629        _serialize: function(obj) {
     
    6164        _formatDate: function(date) {
    6265            return stamp.toISOString(date,{zulu:true,milliseconds:false});
     66        },
     67        _strip: function(obj) {
     68            if ( lang.isArray(obj) ) {
     69                array.forEach(obj,this._strip,this);
     70            } else if ( lang.isObject(obj) ) {
     71                for ( var prop in obj ) {
     72                    if ( obj.hasOwnProperty(prop) ) {
     73                        var v = obj[prop];
     74                        if ( v === null || v === "" || (typeof v === "number" && isNaN(v)) ) {
     75                            delete obj[prop];
     76                        } else {
     77                            this._strip(v);
     78                        }
     79                    }
     80                }
     81            }
     82
    6383        }
    6484    });
  • Dev/trunk/src/client/qed-client/model/widgets/SurveyRunWidget.js

    r494 r506  
    1515        _getValueAttr: function() {
    1616            var value = this.inherited(arguments);
    17             if ( !value.startDate ) { delete value.startDate; }
    18             if ( !value.endDate ) { delete value.endDate; }
    1917            value.respondentCanDeleteOwnResponse =
    2018                value.respondentCanDeleteOwnResponse.length > 0;
  • Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputConfigWidget.js

    r494 r506  
    2020    return declare([_ComplexValueWidget],{
    2121        type: 'MultipleChoiceInput',
     22        baseClass: 'qedMultipleChoiceWidget',
    2223        templateString: template,
    2324        buildRendering: function() {
  • Dev/trunk/src/client/qed-client/model/widgets/questions/NumberInputConfigWidget.js

    r493 r506  
    1010            var value = this.inherited(arguments);
    1111            value.type = this.type;
    12             if ( !value.min ) { delete value.min; }
    13             if ( !value.max ) { delete value.max; }
    14             if ( !value.places ) { delete value.places; }
    1512            return value;
    1613        }
  • Dev/trunk/src/client/qed-client/model/widgets/questions/TextInputConfigWidget.js

    r493 r506  
    1010            var value = this.inherited(arguments);
    1111            value.type = this.type;
    12             if ( !value.maxLength ) { delete value.maxLength; }
    1312            return value;
    1413        }
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/HeaderConfigWidget.html

    r461 r506  
    11<form>
    22  <label for="text" class="qedLabel">Text</label>
    3   <div class="qedField" data-dojo-type="dijit/form/TextBox" name="text"></div>
     3  <div class="qedField" data-dojo-type="dijit/form/ValidationTextBox"
     4       data-dojo-props="'required': true, placeHolder:'Text'"
     5       name="text"></div>
    46</form>
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigRowWidget.html

    r493 r506  
    11<form>
     2    <div data-dojo-type="dijit/form/ValidationTextBox"
     3         data-dojo-props="required: true, placeholder: 'Subcode'"
     4       class="subcode"
     5         name="subcode"></div>
    26  <div data-dojo-type="dijit/form/ValidationTextBox"
    3        name="text" required="required"
    4        data-dojo-attach-point="textBox"></div>
     7       data-dojo-props="required: true, placeholder: 'Item text'"
     8       name="text"></div>
    59  <div data-dojo-type="dijit/form/Button"
    610       data-dojo-attach-event="onClick:onDestroy">X</div>
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigWidget.html

    r493 r506  
    1 <form>
     1<form class="${baseClass}">
    22  <div>
    33    <label class="qedLabel" for="allowMultiple">Allow multiple</label>
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/NumberInputConfigWidget.html

    r461 r506  
    11<form>
     2  <div>
     3    <label class="qedLabel" for="text">Subcode</label>
     4    <div class="qedField"
     5         data-dojo-attach-point="subcodeBox"
     6         data-dojo-type="dijit/form/ValidationTextBox"
     7         data-dojo-props="required: true, placeholder: 'Subcode'"
     8         name="subcode"></div>
     9  </div>
    210  <div>
    311    <label class="qedLabel" for="text">Item/Question Text</label>
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/ScaleInputConfigRowWidget.html

    r443 r506  
    11<tr>
     2  <th class="subcode">
     3    <div data-dojo-type="dijit/form/ValidationTextBox"
     4         data-dojo-props="required: true, placeholder: 'Subcode'"
     5         name="subcode"></div>
     6  </th>
    27  <th class="item">
    38    <div name="text"
     
    611         data-dojo-props="placeholder: 'Item/Question text'"></div>
    712  </th>
    8   <th class="min">
     13  <th class="minLabel">
    914    <div name="minLabel"
    1015         required="required"
     
    1318  </th>
    1419  <td>
    15     <div disabled="disabled"
     20    <div disabled="disabled" class="min"
    1621         data-dojo-type="dijit/form/RadioButton"></div>
    1722  </td>
    1823  <td>...</td>
    1924  <td>
    20     <div disabled="disabled"
     25    <div disabled="disabled" class="max"
    2126         data-dojo-type="dijit/form/RadioButton"></div>
    2227  </td>
    23   <th class="max">
     28  <th class="maxLabel">
    2429    <div name="maxLabel"
    2530         required="required"
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/ScaleInputConfigWidget.html

    r461 r506  
    33    <thead>
    44      <tr>
     5        <th class="subcode"></th>
    56        <th class="item"></th>
    67        <th data-dojo-attach-point="minLabelNode"
    7             class="min">
     8            class="minLabel">
    89          <div name="minLabel"
    910               data-dojo-type="dijit/form/TextBox"
    1011               data-dojo-props="placeholder: 'Minimum label'"></div>
    1112        </th>
    12         <th data-dojo-attach-point="minNode">
     13        <th class="min" data-dojo-attach-point="minNode">
    1314          <div name="min"
    1415               data-dojo-type="dijit/form/NumberTextBox"
     
    1617        </th>
    1718        <th>...</th>
    18         <th data-dojo-attach-point="maxNode">
     19        <th class="max" data-dojo-attach-point="maxNode">
    1920          <div name="max"
    2021               data-dojo-type="dijit/form/NumberTextBox"
    2122               data-dojo-props="required: true, placeholder: 'Maximum value'"></div>
    2223        </th>
    23         <th data-dojo-attach-point="maxLabelNode" class="max">
     24        <th data-dojo-attach-point="maxLabelNode" class="maxLabel">
    2425          <div name="maxLabel"
    2526               data-dojo-type="dijit/form/TextBox"
     
    3738    <tbody data-dojo-attach-point="itemsNode">
    3839    </tbody>
    39     <tbody>
    40       <tr>
    41         <td class="item">
    42           <button data-dojo-type="dijit/form/Button"
    43                   data-dojo-attach-event="onClick:onAddNewItem">Click to add item</button>
    44         </td>
    45       </tr>
    46     </tbody>
    4740  </table>
     41<div>
     42  <button data-dojo-type="dijit/form/Button"
     43          data-dojo-attach-event="onClick:onAddNewItem">
     44    Click to add item</button>
     45</div>
    4846</form>
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/StringInputConfigWidget.html

    r461 r506  
    11<form>
    2   <label class="qedLabel" for="text">Item/Question Text</label>
    3   <div class="qedField" data-dojo-attach-point="textBox" data-dojo-type="dijit/form/TextBox" data-dojo-props="placeholder: 'Item/Question Text'" name="text"></div>
     2  <div>
     3    <label class="qedLabel" for="text">Subcode</label>
     4    <div class="qedField"
     5         data-dojo-attach-point="subcodeBox"
     6         data-dojo-type="dijit/form/ValidationTextBox"
     7         data-dojo-props="required: true, placeholder: 'Subcode'"
     8         name="subcode"></div>
     9  </div>
     10  <div>
     11    <label class="qedLabel" for="text">Item/Question Text</label>
     12    <div class="qedField"
     13         data-dojo-attach-point="textBox"
     14         data-dojo-type="dijit/form/TextBox"
     15         data-dojo-props="placeholder: 'Item/Question Text'"
     16         name="text"></div>
     17  </div>
    418</form>
  • Dev/trunk/src/client/qed-client/model/widgets/questions/templates/TextInputConfigWidget.html

    r461 r506  
    11<form>
     2  <div>
     3    <label class="qedLabel" for="text">Subcode</label>
     4    <div class="qedField"
     5         data-dojo-attach-point="subcodeBox"
     6         data-dojo-type="dijit/form/ValidationTextBox"
     7         data-dojo-props="required: true, placeholder: 'Subcode'"
     8         name="subcode"></div>
     9  </div>
    210  <div>
    311    <label class="qedLabel" for="text">Item/Question Text</label>
  • Dev/trunk/src/client/qed-client/pages/question.js

    r503 r506  
    5555                return this.inherited(arguments);
    5656            } else {
    57                 return new Deferred().reject();
     57                return new Deferred().reject({error:"Please correct invalid values."});
    5858            }
    5959        },
  • Dev/trunk/src/client/qed-client/pages/surveyRun.js

    r500 r506  
    33    "../app/Path",
    44    "../app/Router",
    5     "../lib/func",
    65    "../model/classes/responses",
    76    "../model/classes/surveyRuns",
     
    1716    "require",
    1817    "dojo/text!./templates/surveyRun.html"
    19 ], function(Content, Path, Router, func, responses, surveyRuns, surveys, LineWithActionsWidget, _ObjectPage, Deferred, array, declare, event, lang, when, require, template) {
     18], function(Content, Path, Router, responses, surveyRuns, surveys, LineWithActionsWidget, _ObjectPage, Deferred, array, declare, event, lang, when, require, template) {
    2019    return declare([_ObjectPage],{
    2120        contextRequire: require,
     
    9190                return this.inherited(arguments);
    9291            } else {
    93                 return new Deferred.reject();
     92                return new Deferred().reject({error:"Please correct invalid values."});
    9493            }
    9594        },
  • Dev/trunk/src/client/qed-client/response.js

    r490 r506  
    33    "./app/Page",
    44    "./app/Path",
    5     "./lib/async",
    65    "./model/classes/responses",
    76    "./model/classes/surveyRuns",
     
    1514    "./stddeps",
    1615    "dojo/domReady!"
    17 ], function(Content, Page, Path, async, responses, surveyRuns, ResponsePage, json, date, locale, hash, parser, request) {
     16], function(Content, Page, Path, responses, surveyRuns, ResponsePage, json, date, locale, hash, parser, request) {
    1817    parser.parse();
    1918    Content.startup();
  • Dev/trunk/src/client/qed-client/stddeps.js

    r490 r506  
    2222    'dijit/form/Textarea',
    2323    'dijit/form/TextBox',
     24    'dijit/form/ValidationTextBox',
    2425    'dijit/form/TimeTextBox',
    2526
  • Dev/trunk/src/client/qed-client/widgets/ListWidget.js

    r502 r506  
    2525        _restoreParams: null,
    2626        _onChangeActive: false,
     27        _onChangeHandle: null,
    2728        buildRendering: function() {
    2829            this.inherited(arguments);
     
    8687                }
    8788            }
    88             //this.own(on(nodeOrWidget,'change',lang.hitch(this,'_handleChange')));
    8989            var node = nodeOrWidget.domNode ? nodeOrWidget.domNode : nodeOrWidget;
    9090            if ( hint !== "avatar" && node.id !== id ) {
     
    190190        _handleChange: function(evt) {
    191191            if ( evt.target !== this.domNode ) {
    192                 if ( this._onChangeActive && !(this.readOnly || this.disabled) ) {
    193                     this.emit('change',this.get('value'));
    194                 }
     192                this._onChange();
    195193                if ( evt ) { event.stop(evt); }
    196194                return false;
    197             }
    198             return true;
    199         },
    200         _handleDrop: function() {
    201             if ( this._onChangeActive && !(this.readOnly || this.disabled) ) {
    202                 this.emit('change',this.get('value'));
     195            } else {
     196                return evt;
     197            }
     198        },
     199        _handleDrop: function(evt) {
     200            this._onChange();
     201        },
     202        _onChange: function(){
     203            if ( this._onChangeActive &&
     204                 !(this.readOnly || this.disabled) ) {
     205                if ( this._onChangeHandle ) {
     206                    this._onChangeHandle.cancel();
     207                }
     208                this._onChangeHandle = this.defer(function(){
     209                    this._onChangeHandle = null;
     210                    on.emit(this.domNode,'change',{
     211                        target: this.domNode,
     212                        value: this.get('value'),
     213                        bubbles: true,
     214                        cancellable: true
     215                    });
     216                });
    203217            }
    204218        }
  • Dev/trunk/src/client/qed-client/widgets/_ComplexValueMixin.js

    r500 r506  
    1515        readOnly: false,
    1616        _onChangeActive: false,
     17        _onChangeHandle: null,
    1718        constructor: function() {
    1819            this._listenerMap = {};
     
    9899        _handleChange: function(evt) {
    99100            if ( evt.target !== this.domNode ) {
    100                 if ( this._onChangeActive && !(this.readOnly || this.disabled) ) {
    101                     this.emit('change',this.get('value'));
     101                if ( this._onChangeActive &&
     102                     !(this.readOnly || this.disabled) ) {
     103                    if ( this._onChangeHandle ) {
     104                        this._onChangeHandle.cancel();
     105                    }
     106                    this._onChangeHandle = this.defer(function(){
     107                        this._onChangeHandle = null;
     108                        on.emit(this.domNode,'change',{
     109                            target: this.domNode,
     110                            value: this.get('value'),
     111                            bubbles: true,
     112                            cancellable: true
     113                        });
     114                    });
    102115                }
    103116                if ( evt ) { event.stop(evt); }
    104117                return false;
     118            } else {
     119                return evt;
    105120            }
    106             return true;
    107121        },
    108122        _handleSubmit: function(evt) {
  • Dev/trunk/src/server/config/couchdb-design-docs.js

    r501 r506  
    1111
    1212    "qed/schemaInfo": {
    13         version: "2"
     13        version: "3"
    1414    },
    1515
  • Dev/trunk/src/server/config/couchdb-schema.json

    r499 r506  
    22  "$schema": "http://json-schema.org/draft-04/schema#",
    33  "title": "QED Object Schema",
    4   "version": "2",
     4  "version": "3",
    55  "type": "object",
    66  "oneOf": [
     
    99  ],
    1010  "definitions": {
     11    "nonEmptyString": { "type": "string", "minLength": 1 },
    1112    "schemaInfo": {
    1213      "type": "object",
    1314      "properties": {
    1415          "_id": { "type": "string", "pattern": "^schemaInfo$" },
    15           "_rev": { "type": "string" },
    16           "version": { "type": "string" }
     16          "_rev": { "$ref": "#/definitions/nonEmptyString" },
     17          "version": { "$ref": "#/definitions/nonEmptyString" }
    1718      },
    1819      "required": ["_id","version"],
     
    3334        "properties": {
    3435          "type": { "type": "string", "pattern": "^Question$" },
    35           "_id": { "type": "string" },
    36           "_rev": { "type": "string" },
    37           "categories": { "type": "array", "items": { "type": "string" } },
    38           "code": { "type": "string", "minLength": 1 },
     36          "_id": { "$ref": "#/definitions/nonEmptyString" },
     37          "_rev": { "$ref": "#/definitions/nonEmptyString" },
     38          "categories": { "type": "array", "items": { "$ref": "#/definitions/nonEmptyString" } },
     39          "code": { "$ref": "#/definitions/nonEmptyString" },
    3940          "content": { "type": "array", "items": { "$ref": "#/definitions/content/any" } },
    40           "description": { "type": "string" },
     41          "description": { "$ref": "#/definitions/nonEmptyString" },
    4142          "publicationDate": { "type": "string", "format": "datetime" },
    42           "title": { "type": "string" },
    43           "topic": { "type": "string" }
     43          "title": { "$ref": "#/definitions/nonEmptyString" },
     44          "topic": { "$ref": "#/definitions/nonEmptyString" }
    4445        },
    4546        "required": ["type","categories","code","content","title"],
     
    5051        "properties": {
    5152          "type": { "type": "string", "pattern": "^Survey$" },
    52           "_id": { "type": "string" },
    53           "_rev": { "type": "string" },
    54           "description": { "type": "string" },
     53          "_id": { "$ref": "#/definitions/nonEmptyString" },
     54          "_rev": { "$ref": "#/definitions/nonEmptyString" },
     55          "description": { "$ref": "#/definitions/nonEmptyString" },
    5556          "publicationDate": { "type": "string", "format": "datetime" },
    5657          "questions": { "type": "array", "items": { "$ref": "#/definitions/docs/Question" } },
    57           "title": { "type": "string" }
     58          "title": { "$ref": "#/definitions/nonEmptyString" }
    5859        },
    5960        "required": ["type","questions","title"],
     
    6465        "properties": {
    6566          "type": { "type": "string", "pattern": "^SurveyRun$" },
    66           "_id": { "type": "string" },
    67           "_rev": { "type": "string" },
    68           "description": { "type": "string" },
     67          "_id": { "$ref": "#/definitions/nonEmptyString" },
     68          "_rev": { "$ref": "#/definitions/nonEmptyString" },
     69          "description": { "$ref": "#/definitions/nonEmptyString" },
    6970          "endDate": { "type": "string", "format": "datetime" },
    70           "liveName": { "type": "string" },
     71          "liveName": { "$ref": "#/definitions/nonEmptyString" },
    7172          "mode": { "type": "string", "enum": [ "open", "closed" ] },
    7273          "respondentCanDeleteOwnResponse": { "type": "boolean" },
    73           "secret": { "type": "string", "minLength": 1 },
     74          "secret": { "$ref": "#/definitions/nonEmptyString" },
    7475          "startDate": { "type": "string", "format": "datetime" },
    7576          "survey": { "$ref": "#/definitions/docs/Survey" },
    76           "title": { "type": "string" }
    77         },
    78         "required": ["type","description","mode","secret","survey","title"],
     77          "title": { "$ref": "#/definitions/nonEmptyString" }
     78        },
     79        "required": ["type","mode","secret","survey","title"],
    7980        "additionalProperties": false
    8081      },
     
    8384        "properties": {
    8485          "type": { "type": "string", "pattern": "^Response$" },
    85           "_id": { "type": "string" },
    86           "_rev": { "type": "string" },
     86          "_id": { "$ref": "#/definitions/nonEmptyString" },
     87          "_rev": { "$ref": "#/definitions/nonEmptyString" },
    8788          "answers": { "type": "object" },
    8889          "email": { "type": "string", "format": "email" },
    8990          "publicationDate": { "type": "string", "format": "datetime" },
    90           "secret": { "type": "string", "minLength": 1 },
    91           "surveyRunId": { "type": "string" }
     91          "secret": { "$ref": "#/definitions/nonEmptyString" },
     92          "surveyRunId": { "$ref": "#/definitions/nonEmptyString" }
    9293        },
    9394        "required": ["type","answers","secret","surveyRunId"],
     
    9596      }
    9697    },
    97     "content":{
     98    "content": {
    9899      "any": {
    99100        "type": "object",
     
    113114        "properties": {
    114115          "type": { "type": "string", "pattern": "^Header$" },
    115           "text": { "type": "string" }
     116          "text": { "$ref": "#/definitions/nonEmptyString" }
    116117        },
    117118        "required": ["type","text"],
     
    122123        "properties": {
    123124          "type": { "type": "string", "pattern": "^Text$" },
    124           "text": { "type": "string" }
     125          "text": { "$ref": "#/definitions/nonEmptyString" }
    125126        },
    126127        "required": ["type","text"],
     
    138139        "properties": {
    139140          "type": { "type": "string", "pattern": "^StringInput$" },
    140           "text": { "type": "string" }
    141         },
    142         "required":["type","text"],
     141          "subcode": { "$ref": "#/definitions/nonEmptyString" },
     142          "text": { "$ref": "#/definitions/nonEmptyString" }
     143        },
     144        "required":["type","subcode"],
    143145        "additionalProperties": false
    144146      },
     
    148150          "type": { "type": "string", "pattern": "^TextInput$" },
    149151          "maxLength": { "type": "integer" },
    150           "text": { "type": "string" }
    151         },
    152         "required":["type","text"],
     152          "subcode": { "$ref": "#/definitions/nonEmptyString" },
     153          "text": { "$ref": "#/definitions/nonEmptyString" }
     154        },
     155        "required":["type","subcode"],
    153156        "additionalProperties": false
    154157      },
     
    160163          "max": { "type": "integer" },
    161164          "places": { "type": "integer" },
    162           "text": { "type": "string" }
    163         },
    164         "required":["type","text"],
     165          "subcode": { "$ref": "#/definitions/nonEmptyString" },
     166          "text": { "$ref": "#/definitions/nonEmptyString" }
     167        },
     168        "required":["type","subcode"],
    165169        "additionalProperties": false
    166170      },
     
    169173        "properties": {
    170174          "type": { "type": "string", "pattern": "^ScaleInput$" },
    171           "minLabel": { "type": "string" },
     175          "minLabel": { "$ref": "#/definitions/nonEmptyString" },
    172176          "min": { "type": "integer" },
    173177          "max": { "type": "integer" },
    174           "maxLabel": { "type": "string" },
    175           "naLabel": { "type": "string" },
     178          "maxLabel": { "$ref": "#/definitions/nonEmptyString" },
     179          "naLabel": { "$ref": "#/definitions/nonEmptyString" },
    176180          "items": { "type": "array", "items": {
    177181            "type": "object",
    178182            "properties": {
    179               "text": { "type": "string" },
    180               "minLabel": { "type": "string" },
    181               "maxLabel": { "type": "string" }
     183              "minLabel": { "$ref": "#/definitions/nonEmptyString" },
     184              "maxLabel": { "$ref": "#/definitions/nonEmptyString" },
     185              "subcode": { "$ref": "#/definitions/nonEmptyString" },
     186              "text": { "$ref": "#/definitions/nonEmptyString" }
    182187            },
    183             "required":["text"],
     188            "required":["subcode","text"],
    184189            "additionalProperties": false
    185190          } }
     
    196201              "type": "object",
    197202              "properties": {
    198                   "text": { "type": "string" }
     203                  "subcode": { "$ref": "#/definitions/nonEmptyString" },
     204                  "text": { "$ref": "#/definitions/nonEmptyString" }
    199205              },
    200               "required": ["text"],
     206              "required": ["subcode","text"],
    201207              "additionalProperties": false
    202           } }
     208          } },
     209          "otherItem": {
     210              "type": "object",
     211              "properties": {
     212                  "subcode": { "$ref": "#/definitions/nonEmptyString" },
     213                  "text": { "$ref": "#/definitions/nonEmptyString" }
     214              },
     215              "required": ["subcode","text"],
     216              "additionalProperties": false
     217          }
    203218        },
    204219        "required":["type","items"],
Note: See TracChangeset for help on using the changeset viewer.