Commit b3b1c97b authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Rafael Monnerat

schema.json: Fix required property constraints and provide default values

Also, describe a bit more "serialisation" override mechanism: these
properties cannot be made required at schema level, but for any
software-type entry a serialisation must be provided.
parent 34c6a7fd
......@@ -2,49 +2,56 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Slapos Software Release instantiation descriptor",
"additionalProperties": false,
"required": [
"software-type"
],
"properties": {
"name": {
"description": "A short human-friendly name for the sofware release",
"default": "",
"type": "string"
},
"description": {
"description": "A short description of the sofware release",
"default": "",
"type": "string"
},
"serialisation": {
"description": "How the parameters and results are serialised",
"require": true,
"enum": ["xml", "json-in-xml"],
"type": "string"
},
"software-type": {
"description": "Existing software types",
"require": true,
"patternProperties": {
".*": {
"description": "Software type declaration",
"additionalProperties": false,
"required": [
"request",
"response"
],
"properties": {
"title": {
"description": "A human-friendly title of the software type",
"default": "",
"type": "string"
},
"description": {
"description": "A human-friendly description of the software type",
"default": "",
"type": "string"
},
"serialisation": {
"description": "How the parameters and results are serialised, if different from global setting",
"description": "How the parameters and results are serialised, if different from global setting, required if global setting is not provided",
"enum": ["xml", "json-in-xml"],
"type": "string"
},
"request": {
"require": true,
"description": "URL, relative to Software Release base path, of a json schema for values expected by instance of current software type",
"type": "string"
},
"response": {
"require": true,
"description": "URL, relative to Software Release base path, of a json schema for values published by instance of current software type",
"type": "string"
},
......@@ -54,10 +61,12 @@
},
"shared" : {
"description": "Define if the request will request a Slave or Software Instance.",
"default": "false",
"type": "boolean"
},
"index": {
"description": "Value to use instead of software type id to sort them (in order to display most relevant software types earlier in a list, for example)",
"default": 0,
"type": "number"
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment