diff --git a/docs/static/schemas/draft/2-1-0/application.schema.json b/docs/static/schemas/draft/2-1-0/application.schema.json index e6165282..928b35f9 100644 --- a/docs/static/schemas/draft/2-1-0/application.schema.json +++ b/docs/static/schemas/draft/2-1-0/application.schema.json @@ -600,25 +600,25 @@ "additionalProperties": false, "properties": { "on_start": { - "$ref": "#/$defs/graph/$defs/position" + "$ref": "#/$defs/graph_position" }, "stop": { - "$ref": "#/$defs/graph/$defs/position" + "$ref": "#/$defs/graph_position" }, "buttons": { - "$ref": "#/$defs/graph/$defs/position_group" + "$ref": "#/$defs/graph_position_group" }, "components": { - "$ref": "#/$defs/graph/$defs/position_group" + "$ref": "#/$defs/graph_position_group" }, "hardware": { - "$ref": "#/$defs/graph/$defs/position_group" + "$ref": "#/$defs/graph_position_group" }, "conditions": { - "$ref": "#/$defs/graph/$defs/position_group" + "$ref": "#/$defs/graph_position_group" }, "sequences": { - "$ref": "#/$defs/graph/$defs/position_group" + "$ref": "#/$defs/graph_position_group" } } }, @@ -639,47 +639,50 @@ "description": "Custom edge path coordinates as x, y pairs", "type": "array", "items": { - "$ref": "#/$defs/graph/$defs/position" + "$ref": "#/$defs/graph_position" } } } } } } + } + }, + "graph_position": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Position", + "description": "The position of the element on the graph", + "type": "object", + "additionalProperties": false, + "properties": { + "x": { + "title": "X Position", + "description": "The X position of the element on the graph", + "type": "number", + "multipleOf": 20 + }, + "y": { + "title": "Y Position", + "description": "The Y position of the element on the graph", + "type": "number", + "multipleOf": 20 + } }, - "$defs": { - "position": { + "required": [ + "x", + "y" + ] + }, + "graph_position_group": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Positions", + "description": "A collection of positions of elements on the graph", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[a-z]([a-z0-9_]?[a-z0-9])*$": { "title": "Position", - "description": "The position of the element on the graph", - "type": "object", - "additionalProperties": false, - "properties": { - "x": { - "title": "X Position", - "description": "The X position of the element on the graph", - "type": "number", - "multipleOf": 20 - }, - "y": { - "title": "Y Position", - "description": "The Y position of the element on the graph", - "type": "number", - "multipleOf": 20 - } - }, - "required": [ - "x", - "y" - ] - }, - "position_group": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^[a-z]([a-z0-9_]?[a-z0-9])*$": { - "$ref": "#/$defs/graph/$defs/position" - } - } + "$ref": "#/$defs/graph_position" } } }, @@ -972,29 +975,26 @@ "minItems": 1, "uniqueItems": true, "items": { - "$ref": "#/$defs/on_start/$defs/load_on_start" + "$ref": "#/$defs/on_start/properties/load/oneOf/1" } }, { - "$ref": "#/$defs/on_start/$defs/load_on_start" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Load On Start", + "description": "Identifier for a component or hardware interface to load when the application starts", + "oneOf": [ + { + "$ref": "#/$defs/component_identifier" + }, + { + "$ref": "#/$defs/hardware_identifier" + } + ] } ] }, "sequence": { - "$ref": "#/$defs/sequence_event/$defs/start_a_sequence" - } - }, - "$defs": { - "load_on_start": { - "title": "Load On Start", - "oneOf": [ - { - "$ref": "#/$defs/target_interface/$defs/component_identifier" - }, - { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" - } - ] + "$ref": "#/$defs/start_a_sequence" } } }, @@ -1122,6 +1122,64 @@ } } }, + "start_a_sequence": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Start A Sequence", + "description": "Identifier of a sequence to start", + "type": "object", + "additionalProperties": false, + "properties": { + "start": { + "description": "Name of the sequence to start", + "type": "string", + "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" + } + }, + "required": [ + "start" + ] + }, + "sequence_object": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Manage Sequence Object", + "description": "Start, restart, or abort a sequence", + "type": "object", + "oneOf": [ + { + "$ref": "#/$defs/start_a_sequence" + }, + { + "title": "Restart A Sequence", + "type": "object", + "additionalProperties": false, + "properties": { + "restart": { + "description": "Name of the sequence to restart", + "type": "string", + "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" + } + }, + "required": [ + "restart" + ] + }, + { + "title": "Abort A Sequence", + "type": "object", + "additionalProperties": false, + "properties": { + "abort": { + "description": "Name of the sequence to abort", + "type": "string", + "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" + } + }, + "required": [ + "abort" + ] + } + ] + }, "variables": { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Variables", @@ -1510,13 +1568,13 @@ "description": "Identifier for a component, hardware interface or controller to load or unload", "oneOf": [ { - "$ref": "#/$defs/target_interface/$defs/component_identifier" + "$ref": "#/$defs/component_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/controller_identifier" + "$ref": "#/$defs/controller_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" + "$ref": "#/$defs/hardware_identifier" } ] }, @@ -1630,69 +1688,64 @@ "description": "Identifier for a component, hardware interface or controller to target with an event", "oneOf": [ { - "$ref": "#/$defs/target_interface/$defs/component_identifier" + "$ref": "#/$defs/component_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/controller_identifier" + "$ref": "#/$defs/controller_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" - } - ], - "$defs": { - "component_identifier": { - "description": "A component in the application", - "type": "object", - "additionalProperties": false, - "properties": { - "component": { - "$ref": "#/$defs/identifier" - } - }, - "required": [ - "component" - ] - }, - "controller_identifier": { - "description": "A controller associated with a particular hardware interface", - "type": "object", - "additionalProperties": false, - "properties": { - "hardware": { - "$ref": "#/$defs/identifier" - }, - "controller": { - "$ref": "#/$defs/identifier" - } - }, - "required": [ - "hardware", - "controller" - ] - }, - "hardware_identifier": { - "description": "A hardware interface in the application", - "type": "object", - "additionalProperties": false, - "properties": { - "hardware": { - "$ref": "#/$defs/identifier" - } - }, - "required": [ - "hardware" - ] + "$ref": "#/$defs/hardware_identifier" } - } + ] }, "component_identifier": { - "$ref": "#/$defs/target_interface/$defs/component_identifier" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Component Identifier", + "description": "A component in the application", + "type": "object", + "additionalProperties": false, + "properties": { + "component": { + "$ref": "#/$defs/identifier" + } + }, + "required": [ + "component" + ] }, "controller_identifier": { - "$ref": "#/$defs/target_interface/$defs/controller_identifier" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Controller Identifier", + "description": "A controller associated with a particular hardware interface", + "type": "object", + "additionalProperties": false, + "properties": { + "hardware": { + "$ref": "#/$defs/identifier" + }, + "controller": { + "$ref": "#/$defs/identifier" + } + }, + "required": [ + "hardware", + "controller" + ] }, "hardware_identifier": { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Hardware Identifier", + "description": "A hardware interface in the application", + "type": "object", + "additionalProperties": false, + "properties": { + "hardware": { + "$ref": "#/$defs/identifier" + } + }, + "required": [ + "hardware" + ] }, "application_event": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -1858,68 +1911,13 @@ "type": "array", "minItems": 1, "items": { - "$ref": "#/$defs/sequence_event/$defs/sequence_object" + "$ref": "#/$defs/sequence_object" } }, { - "$ref": "#/$defs/sequence_event/$defs/sequence_object" + "$ref": "#/$defs/sequence_object" } - ], - "$defs": { - "sequence_object": { - "title": "ManageSequenceObject", - "oneOf": [ - { - "$ref": "#/$defs/sequence_event/$defs/start_a_sequence" - }, - { - "title": "Restart A Sequence", - "type": "object", - "additionalProperties": false, - "properties": { - "restart": { - "description": "Name of the sequence to restart", - "type": "string", - "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" - } - }, - "required": [ - "restart" - ] - }, - { - "title": "Abort A Sequence", - "type": "object", - "additionalProperties": false, - "properties": { - "abort": { - "description": "Name of the sequence to abort", - "type": "string", - "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" - } - }, - "required": [ - "abort" - ] - } - ] - }, - "start_a_sequence": { - "title": "Start A Sequence", - "type": "object", - "additionalProperties": false, - "properties": { - "start": { - "description": "Name of the sequence to start", - "type": "string", - "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" - } - }, - "required": [ - "start" - ] - } - } + ] }, "set_event": { "$schema": "https://json-schema.org/draft/2020-12/schema", diff --git a/docs/static/schemas/draft/2-1-0/application.types.schema.json b/docs/static/schemas/draft/2-1-0/application.types.schema.json index e6165282..04d4146e 100644 --- a/docs/static/schemas/draft/2-1-0/application.types.schema.json +++ b/docs/static/schemas/draft/2-1-0/application.types.schema.json @@ -972,30 +972,27 @@ "minItems": 1, "uniqueItems": true, "items": { - "$ref": "#/$defs/on_start/$defs/load_on_start" + "$ref": "#/$defs/on_start/properties/load/oneOf/1" } }, { - "$ref": "#/$defs/on_start/$defs/load_on_start" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Load On Start", + "description": "Identifier for a component or hardware interface to load when the application starts", + "oneOf": [ + { + "$ref": "#/$defs/component_identifier" + }, + { + "$ref": "#/$defs/hardware_identifier" + } + ] } ] }, "sequence": { "$ref": "#/$defs/sequence_event/$defs/start_a_sequence" } - }, - "$defs": { - "load_on_start": { - "title": "Load On Start", - "oneOf": [ - { - "$ref": "#/$defs/target_interface/$defs/component_identifier" - }, - { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" - } - ] - } } }, "sequences": { @@ -1510,13 +1507,13 @@ "description": "Identifier for a component, hardware interface or controller to load or unload", "oneOf": [ { - "$ref": "#/$defs/target_interface/$defs/component_identifier" + "$ref": "#/$defs/component_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/controller_identifier" + "$ref": "#/$defs/controller_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" + "$ref": "#/$defs/hardware_identifier" } ] }, @@ -1630,69 +1627,64 @@ "description": "Identifier for a component, hardware interface or controller to target with an event", "oneOf": [ { - "$ref": "#/$defs/target_interface/$defs/component_identifier" + "$ref": "#/$defs/component_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/controller_identifier" + "$ref": "#/$defs/controller_identifier" }, { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" - } - ], - "$defs": { - "component_identifier": { - "description": "A component in the application", - "type": "object", - "additionalProperties": false, - "properties": { - "component": { - "$ref": "#/$defs/identifier" - } - }, - "required": [ - "component" - ] - }, - "controller_identifier": { - "description": "A controller associated with a particular hardware interface", - "type": "object", - "additionalProperties": false, - "properties": { - "hardware": { - "$ref": "#/$defs/identifier" - }, - "controller": { - "$ref": "#/$defs/identifier" - } - }, - "required": [ - "hardware", - "controller" - ] - }, - "hardware_identifier": { - "description": "A hardware interface in the application", - "type": "object", - "additionalProperties": false, - "properties": { - "hardware": { - "$ref": "#/$defs/identifier" - } - }, - "required": [ - "hardware" - ] + "$ref": "#/$defs/hardware_identifier" } - } + ] }, "component_identifier": { - "$ref": "#/$defs/target_interface/$defs/component_identifier" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Component Identifier", + "description": "A component in the application", + "type": "object", + "additionalProperties": false, + "properties": { + "component": { + "$ref": "#/$defs/identifier" + } + }, + "required": [ + "component" + ] }, "controller_identifier": { - "$ref": "#/$defs/target_interface/$defs/controller_identifier" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Controller Identifier", + "description": "A controller associated with a particular hardware interface", + "type": "object", + "additionalProperties": false, + "properties": { + "hardware": { + "$ref": "#/$defs/identifier" + }, + "controller": { + "$ref": "#/$defs/identifier" + } + }, + "required": [ + "hardware", + "controller" + ] }, "hardware_identifier": { - "$ref": "#/$defs/target_interface/$defs/hardware_identifier" + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Hardware Identifier", + "description": "A hardware interface in the application", + "type": "object", + "additionalProperties": false, + "properties": { + "hardware": { + "$ref": "#/$defs/identifier" + } + }, + "required": [ + "hardware" + ] }, "application_event": { "$schema": "https://json-schema.org/draft/2020-12/schema", diff --git a/schemas/applications/schema/application.schema.json b/schemas/applications/schema/application.schema.json index 0fc98863..7601e100 100644 --- a/schemas/applications/schema/application.schema.json +++ b/schemas/applications/schema/application.schema.json @@ -110,6 +110,12 @@ "graph": { "$ref": "graph.schema.json" }, + "graph_position": { + "$ref": "common/graph_position.schema.json" + }, + "graph_position_group": { + "$ref": "common/graph_position_group.schema.json" + }, "hardware": { "$ref": "hardware.schema.json" }, @@ -122,6 +128,12 @@ "sequences": { "$ref": "sequences.schema.json" }, + "start_a_sequence": { + "$ref": "common/events/start_a_sequence.schema.json" + }, + "sequence_object": { + "$ref": "common/events/sequence_object.schema.json" + }, "variables": { "$ref": "variables.schema.json" }, @@ -156,13 +168,13 @@ "$ref": "common/target_interface.schema.json" }, "component_identifier": { - "$ref": "common/target_interface.schema.json#/$defs/component_identifier" + "$ref": "common/component_identifier.schema.json" }, "controller_identifier": { - "$ref": "common/target_interface.schema.json#/$defs/controller_identifier" + "$ref": "common/controller_identifier.schema.json" }, "hardware_identifier": { - "$ref": "common/target_interface.schema.json#/$defs/hardware_identifier" + "$ref": "common/hardware_identifier.schema.json" }, "application_event": { "$ref": "common/events/application.schema.json" diff --git a/schemas/applications/schema/common/component_identifier.schema.json b/schemas/applications/schema/common/component_identifier.schema.json new file mode 100644 index 00000000..cf0ba70b --- /dev/null +++ b/schemas/applications/schema/common/component_identifier.schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Component Identifier", + "description": "A component in the application", + "type": "object", + "additionalProperties": false, + "properties": { + "component": { + "$ref": "identifier.schema.json" + } + }, + "required": [ + "component" + ] +} diff --git a/schemas/applications/schema/common/controller_identifier.schema.json b/schemas/applications/schema/common/controller_identifier.schema.json new file mode 100644 index 00000000..d9e81e2f --- /dev/null +++ b/schemas/applications/schema/common/controller_identifier.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Controller Identifier", + "description": "A controller associated with a particular hardware interface", + "type": "object", + "additionalProperties": false, + "properties": { + "hardware": { + "$ref": "identifier.schema.json" + }, + "controller": { + "$ref": "identifier.schema.json" + } + }, + "required": [ + "hardware", + "controller" + ] +} diff --git a/schemas/applications/schema/common/events/sequence.schema.json b/schemas/applications/schema/common/events/sequence.schema.json index aeb664e9..fabd2281 100644 --- a/schemas/applications/schema/common/events/sequence.schema.json +++ b/schemas/applications/schema/common/events/sequence.schema.json @@ -7,66 +7,11 @@ "type": "array", "minItems": 1, "items": { - "$ref": "#/$defs/sequence_object" + "$ref": "sequence_object.schema.json" } }, { - "$ref": "#/$defs/sequence_object" + "$ref": "sequence_object.schema.json" } - ], - "$defs": { - "sequence_object": { - "title": "ManageSequenceObject", - "oneOf": [ - { - "$ref": "#/$defs/start_a_sequence" - }, - { - "title": "Restart A Sequence", - "type": "object", - "additionalProperties": false, - "properties": { - "restart": { - "description": "Name of the sequence to restart", - "type": "string", - "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" - } - }, - "required": [ - "restart" - ] - }, - { - "title": "Abort A Sequence", - "type": "object", - "additionalProperties": false, - "properties": { - "abort": { - "description": "Name of the sequence to abort", - "type": "string", - "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" - } - }, - "required": [ - "abort" - ] - } - ] - }, - "start_a_sequence": { - "title": "Start A Sequence", - "type": "object", - "additionalProperties": false, - "properties": { - "start": { - "description": "Name of the sequence to start", - "type": "string", - "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" - } - }, - "required": [ - "start" - ] - } - } + ] } \ No newline at end of file diff --git a/schemas/applications/schema/common/events/sequence_object.schema.json b/schemas/applications/schema/common/events/sequence_object.schema.json new file mode 100644 index 00000000..c394ebd5 --- /dev/null +++ b/schemas/applications/schema/common/events/sequence_object.schema.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Manage Sequence Object", + "description": "Start, restart, or abort a sequence", + "type": "object", + "oneOf": [ + { + "$ref": "start_a_sequence.schema.json" + }, + { + "title": "Restart A Sequence", + "type": "object", + "additionalProperties": false, + "properties": { + "restart": { + "description": "Name of the sequence to restart", + "type": "string", + "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" + } + }, + "required": [ + "restart" + ] + }, + { + "title": "Abort A Sequence", + "type": "object", + "additionalProperties": false, + "properties": { + "abort": { + "description": "Name of the sequence to abort", + "type": "string", + "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" + } + }, + "required": [ + "abort" + ] + } + ] +} diff --git a/schemas/applications/schema/common/events/start_a_sequence.schema.json b/schemas/applications/schema/common/events/start_a_sequence.schema.json new file mode 100644 index 00000000..5454e47f --- /dev/null +++ b/schemas/applications/schema/common/events/start_a_sequence.schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Start A Sequence", + "description": "Identifier of a sequence to start", + "type": "object", + "additionalProperties": false, + "properties": { + "start": { + "description": "Name of the sequence to start", + "type": "string", + "pattern": "^[a-z]([a-z0-9_]?[a-z0-9])*$" + } + }, + "required": [ + "start" + ] +} diff --git a/schemas/applications/schema/common/graph_position.schema.json b/schemas/applications/schema/common/graph_position.schema.json new file mode 100644 index 00000000..721fca24 --- /dev/null +++ b/schemas/applications/schema/common/graph_position.schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Position", + "description": "The position of the element on the graph", + "type": "object", + "additionalProperties": false, + "properties": { + "x": { + "title": "X Position", + "description": "The X position of the element on the graph", + "type": "number", + "multipleOf": 20 + }, + "y": { + "title": "Y Position", + "description": "The Y position of the element on the graph", + "type": "number", + "multipleOf": 20 + } + }, + "required": [ + "x", + "y" + ] +} diff --git a/schemas/applications/schema/common/graph_position_group.schema.json b/schemas/applications/schema/common/graph_position_group.schema.json new file mode 100644 index 00000000..c366f547 --- /dev/null +++ b/schemas/applications/schema/common/graph_position_group.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Positions", + "description": "A collection of positions of elements on the graph", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[a-z]([a-z0-9_]?[a-z0-9])*$": { + "title": "Position", + "$ref": "graph_position.schema.json" + } + } +} diff --git a/schemas/applications/schema/common/hardware_identifier.schema.json b/schemas/applications/schema/common/hardware_identifier.schema.json new file mode 100644 index 00000000..3294bc24 --- /dev/null +++ b/schemas/applications/schema/common/hardware_identifier.schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Hardware Identifier", + "description": "A hardware interface in the application", + "type": "object", + "additionalProperties": false, + "properties": { + "hardware": { + "$ref": "identifier.schema.json" + } + }, + "required": [ + "hardware" + ] +} diff --git a/schemas/applications/schema/common/load_on_start.schema.json b/schemas/applications/schema/common/load_on_start.schema.json new file mode 100644 index 00000000..af4d0cb1 --- /dev/null +++ b/schemas/applications/schema/common/load_on_start.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Load On Start", + "description": "Identifier for a component or hardware interface to load when the application starts", + "oneOf": [ + { + "$ref": "component_identifier.schema.json" + }, + { + "$ref": "hardware_identifier.schema.json" + } + ] +} diff --git a/schemas/applications/schema/common/load_unload_target.schema.json b/schemas/applications/schema/common/load_unload_target.schema.json index 645c1677..2fa149d1 100644 --- a/schemas/applications/schema/common/load_unload_target.schema.json +++ b/schemas/applications/schema/common/load_unload_target.schema.json @@ -4,13 +4,13 @@ "description": "Identifier for a component, hardware interface or controller to load or unload", "oneOf": [ { - "$ref": "target_interface.schema.json#/$defs/component_identifier" + "$ref": "component_identifier.schema.json" }, { - "$ref": "target_interface.schema.json#/$defs/controller_identifier" + "$ref": "controller_identifier.schema.json" }, { - "$ref": "target_interface.schema.json#/$defs/hardware_identifier" + "$ref": "hardware_identifier.schema.json" } ] } diff --git a/schemas/applications/schema/common/target_interface.schema.json b/schemas/applications/schema/common/target_interface.schema.json index 23d9ee83..3254629c 100644 --- a/schemas/applications/schema/common/target_interface.schema.json +++ b/schemas/applications/schema/common/target_interface.schema.json @@ -4,58 +4,13 @@ "description": "Identifier for a component, hardware interface or controller to target with an event", "oneOf": [ { - "$ref": "#/$defs/component_identifier" + "$ref": "component_identifier.schema.json" }, { - "$ref": "#/$defs/controller_identifier" + "$ref": "controller_identifier.schema.json" }, { - "$ref": "#/$defs/hardware_identifier" + "$ref": "hardware_identifier.schema.json" } - ], - "$defs": { - "component_identifier": { - "description": "A component in the application", - "type": "object", - "additionalProperties": false, - "properties": { - "component": { - "$ref": "identifier.schema.json" - } - }, - "required": [ - "component" - ] - }, - "controller_identifier": { - "description": "A controller associated with a particular hardware interface", - "type": "object", - "additionalProperties": false, - "properties": { - "hardware": { - "$ref": "identifier.schema.json" - }, - "controller": { - "$ref": "identifier.schema.json" - } - }, - "required": [ - "hardware", - "controller" - ] - }, - "hardware_identifier": { - "description": "A hardware interface in the application", - "type": "object", - "additionalProperties": false, - "properties": { - "hardware": { - "$ref": "identifier.schema.json" - } - }, - "required": [ - "hardware" - ] - } - } -} \ No newline at end of file + ] +} diff --git a/schemas/applications/schema/graph.schema.json b/schemas/applications/schema/graph.schema.json index 69bc5938..3809cb48 100644 --- a/schemas/applications/schema/graph.schema.json +++ b/schemas/applications/schema/graph.schema.json @@ -13,25 +13,25 @@ "additionalProperties": false, "properties": { "on_start": { - "$ref": "#/$defs/position" + "$ref": "common/graph_position.schema.json" }, "stop": { - "$ref": "#/$defs/position" + "$ref": "common/graph_position.schema.json" }, "buttons": { - "$ref": "#/$defs/position_group" + "$ref": "common/graph_position_group.schema.json" }, "components": { - "$ref": "#/$defs/position_group" + "$ref": "common/graph_position_group.schema.json" }, "hardware": { - "$ref": "#/$defs/position_group" + "$ref": "common/graph_position_group.schema.json" }, "conditions": { - "$ref": "#/$defs/position_group" + "$ref": "common/graph_position_group.schema.json" }, "sequences": { - "$ref": "#/$defs/position_group" + "$ref": "common/graph_position_group.schema.json" } } }, @@ -52,47 +52,12 @@ "description": "Custom edge path coordinates as x, y pairs", "type": "array", "items": { - "$ref": "#/$defs/position" + "$ref": "common/graph_position.schema.json" } } } } } } - }, - "$defs": { - "position": { - "title": "Position", - "description": "The position of the element on the graph", - "type": "object", - "additionalProperties": false, - "properties": { - "x": { - "title": "X Position", - "description": "The X position of the element on the graph", - "type": "number", - "multipleOf": 20 - }, - "y": { - "title": "Y Position", - "description": "The Y position of the element on the graph", - "type": "number", - "multipleOf": 20 - } - }, - "required": [ - "x", - "y" - ] - }, - "position_group": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^[a-z]([a-z0-9_]?[a-z0-9])*$": { - "$ref": "#/$defs/position" - } - } - } } -} \ No newline at end of file +} diff --git a/schemas/applications/schema/on_start.schema.json b/schemas/applications/schema/on_start.schema.json index b821a59b..33aa86d3 100644 --- a/schemas/applications/schema/on_start.schema.json +++ b/schemas/applications/schema/on_start.schema.json @@ -12,29 +12,16 @@ "minItems": 1, "uniqueItems": true, "items": { - "$ref": "#/$defs/load_on_start" + "$ref": "common/load_on_start.schema.json" } }, { - "$ref": "#/$defs/load_on_start" + "$ref": "common/load_on_start.schema.json" } ] }, "sequence": { - "$ref": "common/events/sequence.schema.json#/$defs/start_a_sequence" - } - }, - "$defs": { - "load_on_start": { - "title": "Load On Start", - "oneOf": [ - { - "$ref": "common/target_interface.schema.json#/$defs/component_identifier" - }, - { - "$ref": "common/target_interface.schema.json#/$defs/hardware_identifier" - } - ] + "$ref": "common/events/start_a_sequence.schema.json" } } -} \ No newline at end of file +}