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 @@ ...@@ -2,49 +2,56 @@
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"description": "Slapos Software Release instantiation descriptor", "description": "Slapos Software Release instantiation descriptor",
"additionalProperties": false, "additionalProperties": false,
"required": [
"software-type"
],
"properties": { "properties": {
"name": { "name": {
"description": "A short human-friendly name for the sofware release", "description": "A short human-friendly name for the sofware release",
"default": "",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "A short description of the sofware release", "description": "A short description of the sofware release",
"default": "",
"type": "string" "type": "string"
}, },
"serialisation": { "serialisation": {
"description": "How the parameters and results are serialised", "description": "How the parameters and results are serialised",
"require": true,
"enum": ["xml", "json-in-xml"], "enum": ["xml", "json-in-xml"],
"type": "string" "type": "string"
}, },
"software-type": { "software-type": {
"description": "Existing software types", "description": "Existing software types",
"require": true,
"patternProperties": { "patternProperties": {
".*": { ".*": {
"description": "Software type declaration", "description": "Software type declaration",
"additionalProperties": false, "additionalProperties": false,
"required": [
"request",
"response"
],
"properties": { "properties": {
"title": { "title": {
"description": "A human-friendly title of the software type", "description": "A human-friendly title of the software type",
"default": "",
"type": "string" "type": "string"
}, },
"description": { "description": {
"description": "A human-friendly description of the software type", "description": "A human-friendly description of the software type",
"default": "",
"type": "string" "type": "string"
}, },
"serialisation": { "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"], "enum": ["xml", "json-in-xml"],
"type": "string" "type": "string"
}, },
"request": { "request": {
"require": true,
"description": "URL, relative to Software Release base path, of a json schema for values expected by instance of current software type", "description": "URL, relative to Software Release base path, of a json schema for values expected by instance of current software type",
"type": "string" "type": "string"
}, },
"response": { "response": {
"require": true,
"description": "URL, relative to Software Release base path, of a json schema for values published by instance of current software type", "description": "URL, relative to Software Release base path, of a json schema for values published by instance of current software type",
"type": "string" "type": "string"
}, },
...@@ -54,10 +61,12 @@ ...@@ -54,10 +61,12 @@
}, },
"shared" : { "shared" : {
"description": "Define if the request will request a Slave or Software Instance.", "description": "Define if the request will request a Slave or Software Instance.",
"default": "false",
"type": "boolean" "type": "boolean"
}, },
"index": { "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)", "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" "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