Commit 3bf365c0 authored by Rafael Monnerat's avatar Rafael Monnerat

Partial re-implementation of the Parameter editor

See merge request nexedi/slapos.core!438
parents d058b2a9 7e6313f5
Pipeline #24494 failed with stage
in 0 seconds
...@@ -188,10 +188,11 @@ url_list = [ ...@@ -188,10 +188,11 @@ url_list = [
"gadget_slapos_utils.js", "gadget_slapos_utils.js",
"leaflet.css", "leaflet.css",
"leaflet.js", "leaflet.js",
"tv4.min.js",
"vkbeautify.js", "vkbeautify.js",
"jquery.js", "jquery.js",
"URI.js", "URI.js",
"ref-parser.min.js",
"cfworker-jsonschema-validator.js",
"slapos_load_software_schema.json", "slapos_load_software_schema.json",
"slapos_load_meta_schema_xml.json", "slapos_load_meta_schema_xml.json",
"slapos_load_meta_schema_json_in_xml.json", "slapos_load_meta_schema_json_in_xml.json",
......
...@@ -39,7 +39,7 @@ class TestSlapOSXHTML(SlapOSTestCaseMixin, testXHTML.TestXHTML): ...@@ -39,7 +39,7 @@ class TestSlapOSXHTML(SlapOSTestCaseMixin, testXHTML.TestXHTML):
'erp5_corporate_identity', 'erp5_corporate_identity',
'erp5_corporate_identity_web', 'erp5_corporate_identity_web',
'erp5_notebook', 'erp5_officejs_notebook', 'erp5_notebook', 'erp5_officejs_notebook',
'erp5_web_js_style_ui') 'erp5_web_js_style_ui', 'slapos_hal_json_style')
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
# Live tests all uses the same request. For now we remove cell from # Live tests all uses the same request. For now we remove cell from
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testSlapOSXHTML</string> </value> <value> <string>testSlapOSXHTML</string> </value>
...@@ -55,28 +49,13 @@ ...@@ -55,28 +49,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -89,7 +68,7 @@ ...@@ -89,7 +68,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -98,7 +77,7 @@ ...@@ -98,7 +77,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
<script src="URI.js" type="text/javascript"></script> <script src="URI.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script> <script src="jquery.js" type="text/javascript"></script>
<script src="tv4.min.js" type="text/javascript"></script> <script src="ref-parser.min.js" type="text/javascript"></script>
<script src="cfworker-jsonschema-validator.js" type="text/javascript"></script>
<script src="URI.js" type="text/javascript"></script> <script src="URI.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script> <script src="jiodev.js" type="text/javascript"></script>
<script src="gadget_erp5_page_slap_load_schema.js" type="text/javascript"></script> <script src="gadget_erp5_page_slap_load_schema.js" type="text/javascript"></script>
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>999.37330.56513.53265</string> </value> <value> <string>1003.47746.47713.61474</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1650027159.97</float> <float>1666203779.53</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*jslint nomen: true, maxlen: 200, indent: 2*/ /*jslint nomen: true, maxlen: 200, indent: 2*/
/*global window, rJS, console, RSVP, jQuery, jIO, tv4, URI, JSON, $, btoa */ /*global window, rJS, RSVP, btoa, URI, Validator, jIO, JSON, $RefParser */
(function (window, rJS, $, RSVP, btoa, URI, tv4) { (function (window, rJS, RSVP, btoa, URI, Validator, jIO, JSON, $RefParser) {
"use strict"; "use strict";
var gk = rJS(window);
function getJSON(url) { function getJSON(url) {
var uri = URI(url), var uri = URI(url),
headers = {}, headers = {},
...@@ -31,218 +29,55 @@ ...@@ -31,218 +29,55 @@
}); });
} }
function resolveLocalReference(ref, schema) { rJS(window)
// 2 here is for #/ .declareMethod("getBaseUrl", function (url) {
var i, ref_path = ref.substr(2, ref.length), var base_url, url_uri = URI(url);
parts = ref_path.split("/"); base_url = url_uri.path().split("/");
if (parts.length === 1 && parts[0] === "") { base_url.pop();
// It was uses #/ to reference the entire json so just return it. base_url = url.split(url_uri.path())[0] + base_url.join("/");
return schema; return base_url;
}
for (i = 0; i < parts.length; i += 1) {
schema = schema[parts[i]];
}
return schema;
}
function resolveReference(partial_schema, schema, base_url) {
var parts,
external_schema,
ref = partial_schema.$ref;
if (ref === undefined) {
return new RSVP.Queue().push(function () {
return partial_schema;
});
}
if (ref.substr(0, 1) === "#") {
return new RSVP.Queue().push(function () {
return resolveLocalReference(ref, schema);
});
}
return new RSVP.Queue().push(function () {
if (URI(ref).protocol() === "") {
if (base_url !== undefined) {
ref = base_url + "/" + ref;
}
}
return getJSON(ref);
})
.push(function (json) {
external_schema = JSON.parse(json);
parts = ref.split("#");
ref = "#" + parts[1];
return resolveLocalReference(ref, external_schema);
});
}
function clone(obj) {
return JSON.parse(JSON.stringify(obj));
}
// Inspired from https://github.com/nexedi/dream/blob/master/dream/platform/src/jsplumb/jsplumb.js#L398
function expandSchema(json_schema, full_schema, base_url) {
var i,
expanded_json_schema = clone(json_schema) || {};
if (!expanded_json_schema.properties) {
expanded_json_schema.properties = {};
}
return new RSVP.Queue().push(function () {
if (json_schema.$ref) {
return resolveReference(
json_schema,
full_schema,
base_url
)
.push(function (remote_schema) {
return expandSchema(
remote_schema,
full_schema,
base_url
);
}).push(function (referencedx) {
$.extend(expanded_json_schema, referencedx);
delete expanded_json_schema.$ref;
return true;
});
}
return true;
}).push(function () {
var property, queue = new RSVP.Queue();
function wrapperResolveReference(p) {
return resolveReference(
json_schema.properties[p],
full_schema,
base_url
).push(function (external_schema) {
// console.log(p);
return expandSchema(
external_schema,
full_schema,
base_url
)
.push(function (referencedx) {
$.extend(expanded_json_schema.properties[p], referencedx);
if (json_schema.properties[p].$ref) {
delete expanded_json_schema.properties[p].$ref;
}
return referencedx;
});
});
}
// expand ref in properties
for (property in json_schema.properties) {
if (json_schema.properties.hasOwnProperty(property)) {
queue.push(
wrapperResolveReference.bind(this, property)
);
}
}
return queue;
})
.push(function () {
var zqueue = new RSVP.Queue();
function wrapperExpandSchema(p) {
return expandSchema(
json_schema.allOf[p],
full_schema,
base_url
).push(function (referencedx) {
if (referencedx.properties) {
$.extend(
expanded_json_schema.properties,
referencedx.properties
);
delete referencedx.properties;
}
$.extend(expanded_json_schema, referencedx);
});
}
if (json_schema.allOf) {
for (i = 0; i < json_schema.allOf.length; i += 1) {
zqueue.push(wrapperExpandSchema.bind(this, i));
}
}
return zqueue;
}) })
.push(function () { .declareMethod("loadJSONSchema", function (url, serialisation) {
if (expanded_json_schema.allOf) { var meta_schema_url = "slapos_load_meta_schema.json";
delete expanded_json_schema.allOf;
}
if (expanded_json_schema.$ref) {
delete expanded_json_schema.$ref;
}
// console.log(expanded_json_schema);
return clone(expanded_json_schema);
});
}
function getMetaJSONSchema(serialisation) {
if (serialisation === "xml") { if (serialisation === "xml") {
return getJSON("slapos_load_meta_schema_xml.json"); meta_schema_url = "slapos_load_meta_schema_xml.json";
} }
if (serialisation === "json-in-xml") { if (serialisation === "json-in-xml") {
return getJSON("slapos_load_meta_schema_json_in_xml.json"); meta_schema_url = "slapos_load_meta_schema_json_in_xml.json";
}
return getJSON("slapos_load_meta_schema.json");
} }
return getJSON(meta_schema_url)
function validateJSONSchema(json, base_url, serialisation) {
return getMetaJSONSchema(serialisation)
.push(function (meta_schema) { .push(function (meta_schema) {
if (!tv4.validate(json, meta_schema)) { return new RSVP.Queue()
throw new Error("Non valid JSON schema " + json); .push(function () {
} return $RefParser.dereference(url);
return JSON.parse(json);
}) })
.push(function (schema) { .push(function (schema) {
return expandSchema(schema, schema, base_url); var validator = new Validator(JSON.parse(meta_schema), '7');
}); if (!validator.validate(schema)) {
} throw new Error("Non valid JSON schema " + JSON.stringify(schema));
function validateSoftwareJSONSchema(json) {
return getJSON("slapos_load_software_schema.json")
.push(function (schema) {
if (!tv4.validate(json, schema)) {
throw new Error("Non valid JSON for software.cfg.json:" + json);
}
return JSON.parse(json);
});
} }
return schema;
gk
.declareMethod("getBaseUrl", function (url) {
var base_url, url_uri = URI(url);
base_url = url_uri.path().split("/");
base_url.pop();
base_url = url.split(url_uri.path())[0] + base_url.join("/");
return base_url;
})
.declareMethod("loadJSONSchema", function (url, serialisation) {
var gadget = this;
return getJSON(url)
.push(function (json) {
return gadget.getBaseUrl(url)
.push(function (base_url) {
return validateJSONSchema(json, base_url, serialisation);
}); });
}); });
}) })
.declareMethod("loadSoftwareJSON", function (url) { .declareMethod("loadSoftwareJSON", function (url) {
return getJSON(url) return getJSON(url)
.push(function (json) { .push(function (software_cfg_json) {
return validateSoftwareJSONSchema(json); return new RSVP.Queue()
.push(function () {
return $RefParser
.dereference("slapos_load_software_schema.json");
})
.push(function (software_schema) {
var software_json = JSON.parse(software_cfg_json),
validator = new Validator(software_schema, '7');
if (!validator.validate(software_json)) {
throw new Error("Non valid JSON for software.cfg.json:" + software_cfg_json);
}
return software_json;
});
}); });
}) })
...@@ -255,13 +90,12 @@ ...@@ -255,13 +90,12 @@
} }
} }
return getJSON(parameter_schema_url) return new RSVP.Queue()
.push(function (json) { .push(function () {
var schema = JSON.parse(json); return $RefParser.dereference(parameter_schema_url);
return expandSchema(schema, schema, base_url) })
.push(function (loaded_json) { .push(function (schema) {
return tv4.validateMultiple(generated_json, loaded_json); return new Validator(schema, '7', false).validate(generated_json);
});
}); });
}); });
}(window, rJS, $, RSVP, btoa, URI, tv4)); }(window, rJS, RSVP, btoa, URI, Validator, jIO, JSON, $RefParser));
\ No newline at end of file
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>982.28125.59086.62805</string> </value> <value> <string>1003.58311.45202.41659</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1583836689.5</float> <float>1666754395.83</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.42210.9826.36164</string> </value> <value> <string>1003.61829.49064.29661</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1656947623.15</float> <float>1666975592.36</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -69,10 +69,17 @@ ...@@ -69,10 +69,17 @@
}) })
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this;
if (options.url_string === undefined) { if (options.url_string === undefined) {
options.url_string = ""; options.url_string = "";
} }
return this.changeState({
"url_string": options.url_string,
"parameter_output": options.parameter_output
})
})
.onStateChange(function onStateChange() {
var gadget = this;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
...@@ -85,19 +92,19 @@ ...@@ -85,19 +92,19 @@
parameter_dict, parameter_dict,
default_url; default_url;
if (options.url_string === "") { if (gadget.state.url_string === "") {
default_url = result[1] + "sample-software-schema/simpledemo/software.cfg"; default_url = result[1] + "sample-software-schema/simpledemo/software.cfg";
} else { } else {
default_url = options.url_string; default_url = gadget.state.url_string;
} }
if (options.parameter_output === undefined) { if (gadget.state.parameter_output === undefined) {
parameter_hash = btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>'); parameter_hash = btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>');
} else { } else {
parameter_hash = btoa(options.parameter_output); parameter_hash = btoa(gadget.state.parameter_output);
} }
parameter_dict = { parameter_dict = {
'parameter' : { 'parameter' : {
'json_url': options.url_string.split('?')[0] + ".json", 'json_url': gadget.state.url_string.split('?')[0] + ".json",
'parameter_hash': parameter_hash, 'parameter_hash': parameter_hash,
'restricted_softwaretype': false 'restricted_softwaretype': false
} }
...@@ -111,7 +118,7 @@ ...@@ -111,7 +118,7 @@
"default": default_url, "default": default_url,
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": options.url_string === "", "editable": gadget.state.url_string === "",
"key": "url_string", "key": "url_string",
"hidden": 0, "hidden": 0,
"type": "StringField" "type": "StringField"
...@@ -122,25 +129,38 @@ ...@@ -122,25 +129,38 @@
"default": parameter_dict, "default": parameter_dict,
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": options.url_string !== "", "editable": gadget.state.url_string !== "",
"url": "gadget_erp5_page_slap_parameter_form.html", "url": "gadget_erp5_page_slap_parameter_form.html",
"sandbox": "", "sandbox": "",
"key": "text_content", "key": "text_content",
"hidden": options.url_string === "", "hidden": gadget.state.url_string === "",
"type": "GadgetField" "type": "GadgetField"
}, },
"your_parameter_output": { "your_parameter_output": {
"description": "", "description": "",
"title": "Parameters Output", "title": "Parameters Output",
"default": options.parameter_output, "default": gadget.state.parameter_output,
"css_class": "", "css_class": "",
"required": 0, "required": 0,
"editable": 0, "editable": 0,
"sandbox": "", "sandbox": "",
"key": "parameter_output", "key": "parameter_output",
"hidden": options.parameter_output === undefined, "hidden": gadget.state.parameter_output === undefined,
"type": "TextAreaField" "type": "TextAreaField"
} },
"your_parameter_hash": {
"description": "",
"title": "Parameters Hash",
"default": parameter_hash,
"css_class": "",
"required": 0,
"editable": 0,
"sandbox": "",
"key": "parameter_hash",
"hidden": gadget.state.parameter_output === undefined,
"type": "StringField"
},
}}, }},
"_links": { "_links": {
"type": { "type": {
...@@ -152,13 +172,19 @@ ...@@ -152,13 +172,19 @@
form_definition: { form_definition: {
group_list: [[ group_list: [[
"center", "center",
[["my_url_string"], ["your_parameter_output"], ["your_text_content"]] [["my_url_string"], ["your_parameter_output"], ["your_parameter_hash"], ["your_text_content"]]
]] ]]
} }
}) })
.push(function () { .push(function () {
return gadget.getUrlFor({"command": "change",
"options": {"url_string": undefined,
"parameter_output": undefined}});
})
.push(function (selection_url) {
return gadget.updateHeader({ return gadget.updateHeader({
page_title: "Parameter testing page", page_title: "Parameter testing page",
selection_url: selection_url,
submit_action: true submit_action: true
}); });
}); });
......
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.3592.26006.62702</string> </value> <value> <string>1003.56162.18447.41164</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1652201764.17</float> <float>1666635866.16</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
{ {
"id": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "http://json-schema.org/draft-04/schema#", "title": "Core schema meta-schema",
"description": "Core schema meta-schema",
"definitions": { "definitions": {
"schemaArray": { "schemaArray": {
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": { "$ref": "#" } "items": { "$ref": "#" }
}, },
"positiveInteger": { "nonNegativeInteger": {
"type": "integer", "type": "integer",
"minimum": 0 "minimum": 0
}, },
"positiveIntegerDefault0": { "nonNegativeIntegerDefault0": {
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] "allOf": [
{ "$ref": "#/definitions/nonNegativeInteger" },
{ "default": 0 }
]
}, },
"simpleTypes": { "simpleTypes": {
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] "enum": [
"array",
"boolean",
"integer",
"null",
"number",
"object",
"string"
]
}, },
"stringArray": { "stringArray": {
"type": "array", "type": "array",
"items": { "type": "string" }, "items": { "type": "string" },
"minItems": 1, "uniqueItems": true,
"uniqueItems": true "default": []
} }
}, },
"type": "object", "type": ["object", "boolean"],
"properties": { "properties": {
"id": { "$id": {
"type": "string", "type": "string"
"format": "uri"
}, },
"$schema": { "$schema": {
"type": "string", "type": "string"
"format": "uri" },
"$ref": {
"type": "string"
},
"$comment": {
"type": "string"
}, },
"title": { "title": {
"type": "string" "type": "string"
...@@ -41,62 +55,59 @@ ...@@ -41,62 +55,59 @@
"description": { "description": {
"type": "string" "type": "string"
}, },
"default": {}, "default": true,
"readOnly": {
"type": "boolean",
"default": false
},
"writeOnly": {
"type": "boolean",
"default": false
},
"examples": {
"type": "array",
"items": true
},
"multipleOf": { "multipleOf": {
"type": "number", "type": "number",
"minimum": 0, "exclusiveMinimum": 0
"exclusiveMinimum": true
}, },
"maximum": { "maximum": {
"type": "number" "type": "number"
}, },
"exclusiveMaximum": { "exclusiveMaximum": {
"type": "boolean", "type": "number"
"default": false
}, },
"minimum": { "minimum": {
"type": "number" "type": "number"
}, },
"exclusiveMinimum": { "exclusiveMinimum": {
"type": "boolean", "type": "number"
"default": false
}, },
"maxLength": { "$ref": "#/definitions/positiveInteger" }, "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
"pattern": { "pattern": {
"type": "string", "type": "string"
"format": "regex"
},
"additionalItems": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
}, },
"additionalItems": { "$ref": "#" },
"items": { "items": {
"anyOf": [ "anyOf": [
{ "$ref": "#" }, { "$ref": "#" },
{ "$ref": "#/definitions/schemaArray" } { "$ref": "#/definitions/schemaArray" }
], ],
"default": {} "default": true
}, },
"maxItems": { "$ref": "#/definitions/positiveInteger" }, "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
"uniqueItems": { "uniqueItems": {
"type": "boolean", "type": "boolean",
"default": false "default": false
}, },
"maxProperties": { "$ref": "#/definitions/positiveInteger" }, "contains": { "$ref": "#" },
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
"required": { "$ref": "#/definitions/stringArray" }, "required": { "$ref": "#/definitions/stringArray" },
"additionalProperties": { "additionalProperties": { "$ref": "#" },
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
},
"definitions": { "definitions": {
"type": "object", "type": "object",
"additionalProperties": { "$ref": "#" }, "additionalProperties": { "$ref": "#" },
...@@ -110,6 +121,7 @@ ...@@ -110,6 +121,7 @@
"patternProperties": { "patternProperties": {
"type": "object", "type": "object",
"additionalProperties": { "$ref": "#" }, "additionalProperties": { "$ref": "#" },
"propertyNames": {},
"default": {} "default": {}
}, },
"dependencies": { "dependencies": {
...@@ -121,8 +133,11 @@ ...@@ -121,8 +133,11 @@
] ]
} }
}, },
"propertyNames": { "$ref": "#" },
"const": true,
"enum": { "enum": {
"type": "array", "type": "array",
"items": true,
"minItems": 1, "minItems": 1,
"uniqueItems": true "uniqueItems": true
}, },
...@@ -137,14 +152,16 @@ ...@@ -137,14 +152,16 @@
} }
] ]
}, },
"format": { "type": "string" },
"contentMediaType": { "type": "string" },
"contentEncoding": { "type": "string" },
"if": { "$ref": "#" },
"then": { "$ref": "#" },
"else": { "$ref": "#" },
"allOf": { "$ref": "#/definitions/schemaArray" }, "allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" }, "anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" }, "oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" } "not": { "$ref": "#" }
}, },
"dependencies": { "default": true
"exclusiveMaximum": [ "maximum" ],
"exclusiveMinimum": [ "minimum" ]
},
"default": {}
} }
\ No newline at end of file
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>999.27453.45440.44629</string> </value> <value> <string>1003.46346.29825.45516</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1649434525.63</float> <float>1666036519.04</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"description": "Slapos Software Release instantiation descriptor", "description": "Slapos Software Release instantiation descriptor",
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
......
...@@ -239,7 +239,7 @@ https://lab.nexedi.com/nexedi/slapos/raw/master/schema.json#</string> </value> ...@@ -239,7 +239,7 @@ https://lab.nexedi.com/nexedi/slapos/raw/master/schema.json#</string> </value>
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>999.32250.5458.58606</string> </value> <value> <string>1003.46353.55894.19370</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +257,7 @@ https://lab.nexedi.com/nexedi/slapos/raw/master/schema.json#</string> </value> ...@@ -257,7 +257,7 @@ https://lab.nexedi.com/nexedi/slapos/raw/master/schema.json#</string> </value>
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1649721266.53</float> <float>1666036947.97</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>cfworker-jsonschema-validator.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>validator.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>ref-parser.min.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>minimal_dual_type</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Sample paremeters for a Simple Demo under json-in-xml",
"properties": {
"simple-string-in-json": {
"title": "Another string on JSON",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
},
"simple-integer-in-json": {
"title": "Another Integer on JSON",
"description": "Example of Simple Integer",
"type": "integer",
"default": 1
}
}
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>instance-input-json-in-xml-schema.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Sample paremeters for a Simple Demo",
"properties": {
"simple-string": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
},
"simple-integer": {
"title": "Example of Simple Integer",
"description": "Example of Simple Integer",
"type": "integer",
"default": 1
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>instance-input-schema.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"name": "Simple Demo",
"description": "Demo Simple",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"description": "Default reference parameters",
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"index": 0
},
"jsondefault": {
"title": "JSON in XML",
"serialisation": "json-in-xml",
"description": "Default reference parameters under json-in-xml",
"request": "instance-input-json-in-xml-schema.json",
"response": "instance-output-schema.json",
"index": 1
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>software.cfg.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>software.cfg</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>minimal_json_in_xml_demo</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Sample paremeters for a Simple Demo",
"properties": {
"simple-string": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
},
"simple-string-with-enum": {
"title": "Example of Simple String with enum",
"description": "Example of Simple String with enum",
"type": "string",
"enum" : [
"simple string A",
"simple string B",
"simple string C"
],
"default": "simple string A"
},
"simple-boolean": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "boolean",
"default": true
},
"simple-string-with-text-area": {
"title": "Example of Simple String with textarea",
"description": "Example of Simple String with text area",
"type": "string",
"default": "Simple string",
"textarea": true
},
"simple-integer": {
"title": "Example of Simple Integer",
"description": "Example of Simple Integer",
"type": "integer",
"default": 1
},
"simple-integer-with-enum": {
"title": "Example of Simple Integer with enum",
"description": "Example of Simple Integer with enum",
"type": "integer",
"default": 1,
"enum": [
1,
2,
3,
5,
7,
11,
13,
17
]
},
"simple-numeric-integer": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0
},
"simple-numeric-integer-enum": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0,
"enum": [
1.0,
2.0,
3.0,
5.0,
7.0,
11.0,
13.0,
17.0
]
},
"simple-numeric-float": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5
},
"simple-numeric-float-enum": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5,
"enum": [
0.25,
0.75,
1.25,
1.5
]
},
"simple-array-of-string": {
"title": "Example of Simple array of String",
"description": "Example of Array of String",
"type": "array",
"items": {"type": "string"}
},
"simple-array-of-integer": {
"title": "Example of Simple array of Integer",
"description": "Example of Array of Interger",
"type": "array",
"items": {"type": "integer"}
},
"simple-array-of-number": {
"title": "Example of Simple array of Numbers",
"description": "Example of Array of Numbers",
"type": "array",
"items": {"type": "number"}
},
"simple-object": {
"title": "Example of Single Object",
"description": "Example of Single Object",
"type": "object",
"properties": {
"sample-object-string": {
"title": "Example of Simple String on an object",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
},
"simple-object-with-integer": {
"title": "Example of Simple Integer",
"description": "Example of Simple Integer",
"type": "integer",
"default": 1
},
"simple-object-with-integer-with-enum": {
"title": "Example of Simple Integer with enum",
"description": "Example of Simple Integer with enum",
"type": "integer",
"default": 1,
"enum": [
1,
2
]
}
}
},
"simple-object-dict": {
"title": "Example of multi objects as a Dict",
"description": "Example of multi objects as a Dict",
"type": "object",
"patternProperties": {
".*": {
"properties": {
"simple-object-dict-string-example": {
"title": "Example of the String as part of Object",
"description": "Example of the String as part of Object",
"type": "string",
"default": ""
},
"simple-object-dict-string-with-enum": {
"title": "Example of the String as part of Object with Enum",
"description": "Example of the String as part of Object with Enum",
"type": "string",
"default": "String Sample A",
"enum": [
"String Sample A",
"String Sample B"
]
}
}
}
}
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>instance-input-schema.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"name": "Simple Demo",
"description": "Demo Simple",
"serialisation": "json-in-xml",
"software-type": {
"default": {
"title": "Default",
"description": "Default reference parameters",
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"index": 0
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>software.cfg.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>software.cfg</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>minimal_xml_demo</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Sample paremeters for a Simple Demo with required",
"required": [
"simple-string",
"simple-string-with-enum",
"simple-boolean",
"simple-string-with-text-area",
"simple-integer",
"simple-integer-with-enum",
"simple-numeric-integer",
"simple-numeric-integer-enum",
"simple-numeric-float",
"simple-numeric-float-enum"
],
"properties": {
"simple-string": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
},
"simple-string-with-enum": {
"title": "Example of Simple String with enum",
"description": "Example of Simple String with enum",
"type": "string",
"enum" : [
"simple string A",
"simple string B",
"simple string C"
],
"default": "simple string A"
},
"simple-boolean": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "boolean",
"default": true
},
"simple-string-with-text-area": {
"title": "Example of Simple String with textarea",
"description": "Example of Simple String with text area",
"type": "string",
"default": "Simple string",
"textarea": true
},
"simple-integer": {
"title": "Example of Simple Integer",
"description": "Example of Simple Integer",
"type": "integer",
"default": 1
},
"simple-integer-with-enum": {
"title": "Example of Simple Integer with enum",
"description": "Example of Simple Integer with enum",
"type": "integer",
"default": 1,
"enum": [
1,
2,
3,
5,
7,
11,
13,
17
]
},
"simple-numeric-integer": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0
},
"simple-numeric-integer-enum": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0,
"enum": [
1.0,
2.0,
3.0,
5.0,
7.0,
11.0,
13.0,
17.0
]
},
"simple-numeric-float": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5
},
"simple-numeric-float-enum": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5,
"enum": [
0.25,
0.75,
1.25,
1.5
]
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>instance-input-schema-required.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Sample paremeters for a Simple Demo",
"properties": {
"simple-string": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
},
"simple-string-with-enum": {
"title": "Example of Simple String with enum",
"description": "Example of Simple String with enum",
"type": "string",
"enum" : [
"simple string A",
"simple string B",
"simple string C"
],
"default": "simple string A"
},
"simple-boolean": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "boolean",
"default": true
},
"simple-string-with-text-area": {
"title": "Example of Simple String with textarea",
"description": "Example of Simple String with text area",
"type": "string",
"default": "Simple string",
"textarea": true
},
"simple-integer": {
"title": "Example of Simple Integer",
"description": "Example of Simple Integer",
"type": "integer",
"default": 1
},
"simple-integer-with-enum": {
"title": "Example of Simple Integer with enum",
"description": "Example of Simple Integer with enum",
"type": "integer",
"default": 1,
"enum": [
1,
2,
3,
5,
7,
11,
13,
17
]
},
"simple-numeric-integer": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0
},
"simple-numeric-integer-enum": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0,
"enum": [
1.0,
2.0,
3.0,
5.0,
7.0,
11.0,
13.0,
17.0
]
},
"simple-numeric-float": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5
},
"simple-numeric-float-enum": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5,
"enum": [
0.25,
0.75,
1.25,
1.5
]
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>instance-input-schema.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{
"name": "Simple Demo",
"description": "Demo Simple",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"description": "Default reference parameters",
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"index": 0
},
"default-required": {
"title": "Required Example",
"description": "Default reference parameters with required",
"request": "instance-input-schema-required.json",
"response": "instance-output-schema.json",
"index": 0
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>software.cfg.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>software.cfg</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"type": "object", "type": "object",
"description": "Extend simple parameter extension with extra only supported on json-in-xml", "description": "Extend simple parameter extension with extra only supported on json-in-xml",
"additionalProperties": false, "required": ["simple-object-is-required"],
"allOf": [ "allOf": [
{ {
"$ref": "instance-input-schema.json#/" "$ref": "instance-input-schema.json#"
}, },
{ {
"properties": { "properties": {
...@@ -56,6 +56,33 @@ ...@@ -56,6 +56,33 @@
} }
} }
}, },
"simple-object-with-required": {
"title": "Example of Single Object",
"description": "Example of Single Object",
"type": "object",
"required": ["sample-object-string"],
"properties": {
"sample-object-string": {
"title": "Example of Simple String on an object",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string"
}
}
},
"simple-object-is-required": {
"title": "Example of Single Object",
"description": "Example of Single Object",
"type": "object",
"properties": {
"sample-object-string": {
"title": "Example of Simple String on an object",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
}
}
},
"simple-object-dict": { "simple-object-dict": {
"title": "Example of multi objects as a Dict", "title": "Example of multi objects as a Dict",
"description": "Example of multi objects as a Dict", "description": "Example of multi objects as a Dict",
......
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"type": "object", "type": "object",
"description": "Sample paremeters for a Simple Demo", "description": "Sample paremeters for a Simple Demo",
"additionalProperties": false, "required": [
"simple-string-required",
"simple-string-with-enum-required"
],
"properties": { "properties": {
"simple-string": { "simple-string": {
"title": "Example of Simple String", "title": "Example of Simple String",
...@@ -21,6 +24,23 @@ ...@@ -21,6 +24,23 @@
], ],
"default": "simple string A" "default": "simple string A"
}, },
"simple-string-required": {
"title": "Example of Simple String Required",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string Required"
},
"simple-string-with-enum-required": {
"title": "Example of Simple String with enum",
"description": "Example of Simple String with enum",
"type": "string",
"enum" : [
"required string A",
"required string B",
"required string C"
],
"default": "required string A"
},
"simple-boolean": { "simple-boolean": {
"title": "Example of Simple String", "title": "Example of Simple String",
"description": "Example of Simple String", "description": "Example of Simple String",
......
...@@ -194,7 +194,6 @@ web_page_module/rjs_slapos_load_software_schema_json ...@@ -194,7 +194,6 @@ web_page_module/rjs_slapos_load_software_schema_json
web_page_module/rjs_gadget_slapos_login_page_css web_page_module/rjs_gadget_slapos_login_page_css
web_page_module/rjs_gadget_erp5_page_slap_test_parameter_form_js web_page_module/rjs_gadget_erp5_page_slap_test_parameter_form_js
web_page_module/rjs_gadget_erp5_page_slap_test_parameter_form_html web_page_module/rjs_gadget_erp5_page_slap_test_parameter_form_html
web_page_module/rjs_tv4_min_js
web_page_module/rjs_vkbeautify_js web_page_module/rjs_vkbeautify_js
web_site_module/hostingjs web_site_module/hostingjs
web_site_module/hostingjs/** web_site_module/hostingjs/**
\ No newline at end of file
...@@ -198,7 +198,6 @@ web_page_module/rjs_slapos_load_meta_schema_json ...@@ -198,7 +198,6 @@ web_page_module/rjs_slapos_load_meta_schema_json
web_page_module/rjs_slapos_load_meta_schema_xml_in_json_json web_page_module/rjs_slapos_load_meta_schema_xml_in_json_json
web_page_module/rjs_slapos_load_meta_schema_xml_json web_page_module/rjs_slapos_load_meta_schema_xml_json
web_page_module/rjs_slapos_load_software_schema_json web_page_module/rjs_slapos_load_software_schema_json
web_page_module/rjs_tv4_min_js
web_page_module/rjs_vkbeautify_js web_page_module/rjs_vkbeautify_js
web_site_module/hostingjs web_site_module/hostingjs
web_site_module/hostingjs/** web_site_module/hostingjs/**
\ No newline at end of file
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>testSlapOSJSServiceInvalidParameter</string> </value> <value> <string>testSlapOSJSTestParameterEditorAllOf</string> </value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testSlapOSJSTestParameterEditorChangeSerialisation</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testSlapOSJSTestParameterEditorInvalidParameter</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testSlapOSJSTestParameterEditorJSONinXML</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testSlapOSJSTestParameterEditorKVMDefault</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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