Reverted form description name to "schema". Backwards compatible

This commit is contained in:
Joel Collins 2019-09-14 16:20:46 +01:00
parent f25f615a3e
commit 11e64cf952
5 changed files with 6 additions and 198 deletions

View file

@ -7,7 +7,7 @@
"isTask": false,
"selfUpdate": true,
"route": "/hello",
"form": [
"schema": [
{
"fieldType": "textInput",
"placeholder": "Enter a string",
@ -21,7 +21,7 @@
"isTask": true,
"route": "/timelapse",
"submitLabel": "Start timelapse",
"form": [
"schema": [
{
"fieldType": "numberInput",
"name": "n_images",

View file

@ -9,7 +9,7 @@
"selfUpdate": true,
"route": "/do",
"submitLabel": "Do things",
"form": [
"schema": [
{
"fieldType": "numberInput",
"placeholder": "Some integer",
@ -75,7 +75,7 @@
"selfUpdate": true,
"route": "/task",
"submitLabel": "Start task",
"form": [
"schema": [
{
"fieldType": "numberInput",
"name": "run_time",

View file

@ -1,5 +0,0 @@
Full JSON Form
================
.. literalinclude:: schema.json
:language: JSON

View file

@ -1,187 +0,0 @@
{
"definitions": {},
"$form": "http://json-form.org/draft-07/form#",
"$id": "http://example.com/root.json",
"type": "object",
"title": "The Root Form",
"required": [
"id",
"icon",
"forms"
],
"properties": {
"id": {
"$id": "#/properties/id",
"type": "string",
"title": "Unique ID",
"description": "A unique name for the plugin UI",
"default": "",
"examples": [
"test-plugin"
],
"pattern": "^(.*)$"
},
"icon": {
"$id": "#/properties/icon",
"type": "string",
"title": "Icon name",
"description": "Name of the Material Design icon to use for the plugin tab",
"default": "",
"examples": [
"pets"
],
"pattern": "^(.*)$"
},
"forms": {
"$id": "#/properties/forms",
"type": "array",
"title": "Forms array",
"description": "Array of form descriptions to be displayed",
"default": null,
"items": {
"$id": "#/properties/forms/items",
"type": "object",
"title": "The Items Form",
"required": [
"name",
"route",
"form"
],
"properties": {
"name": {
"$id": "#/properties/forms/items/properties/name",
"type": "string",
"title": "Form name",
"description": "Human-readable form name",
"default": "",
"examples": [
"Simple request"
],
"pattern": "^(.*)$"
},
"isCollapsible": {
"$id": "#/properties/forms/items/properties/isCollapsible",
"type": "boolean",
"title": "The isCollapsible Form",
"description": "Should the form be rendered as a collapsible item",
"default": false,
"examples": [
true
]
},
"isTask": {
"$id": "#/properties/forms/items/properties/isTask",
"type": "boolean",
"title": "The isTask Form",
"description": "Should the form's submit function be treated as a long-running task",
"default": false,
"examples": [
false
]
},
"selfUpdate": {
"$id": "#/properties/forms/items/properties/selfUpdate",
"type": "boolean",
"title": "The selfUpdate Form",
"description": "Should the form's component values be automatically updated with a GET request",
"default": false,
"examples": [
true
]
},
"route": {
"$id": "#/properties/forms/items/properties/route",
"type": "string",
"title": "The Route Form",
"description": "Form submit POST request's corresponding api_views route",
"default": "",
"examples": [
"/do"
],
"pattern": "^(.*)$"
},
"submitLabel": {
"$id": "#/properties/forms/items/properties/submitLabel",
"type": "string",
"title": "The submitLabel Form",
"description": "String to place in submit button",
"default": "Submit",
"examples": [
"Do my function"
],
"pattern": "^(.*)$"
},
"form": {
"$id": "#/properties/forms/items/properties/form",
"type": "array",
"title": "Form component array",
"items": {
"$id": "#/properties/forms/items/properties/form/items",
"type": "object",
"title": "A form component",
"required": [
"fieldType",
"name"
],
"properties": {
"fieldType": {
"$id": "#/properties/forms/items/properties/form/items/properties/fieldType",
"type": "string",
"title": "Component type",
"default": "",
"examples": [
"numberInput",
"textInput",
"radioList",
"checkList",
"htmlBlock",
"selectList",
"textInput",
"keyvalList",
"taglList"
],
"pattern": "^(.*)$"
},
"placeholder": {
"$id": "#/properties/forms/items/properties/form/items/properties/placeholder",
"type": "string",
"title": "Component placeholder value",
"default": "",
"examples": [
"Enter your name"
],
"pattern": "^(.*)$"
},
"name": {
"$id": "#/properties/forms/items/properties/form/items/properties/name",
"type": "string",
"title": "Unique component name",
"examples": [
"my_form_component_1"
],
"pattern": "^(.*)$"
},
"label": {
"$id": "#/properties/forms/items/properties/form/items/properties/label",
"type": "string",
"title": "Component label (if applicable)",
"default": "",
"examples": [
"My form component"
],
"pattern": "^(.*)$"
},
"value": {
"$id": "#/properties/forms/items/properties/form/items/properties/value",
"type": ["array", "boolean", "integer", "number", "object", "string"],
"title": "Component value",
"pattern": "^(.*)$"
}
}
}
}
}
}
}
}
}