diff --git a/src/external/td-schema-full.json b/src/external/td-schema-full.json index 0bacf2e0..1d9692b6 100644 --- a/src/external/td-schema-full.json +++ b/src/external/td-schema-full.json @@ -1,1329 +1,1311 @@ { - "title": "Thing Description", - "version": "1.1-10-June-2022", - "description": "JSON Schema for validating TD instances against the TD information model. For a TD to validate this schema it must contain all the default terms defined in Section 5.4", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "anyUri": { - "type": "string" - }, - "description": { - "type": "string" - }, - "descriptions": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "title": { - "type": "string" - }, - "titles": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "security": { - "oneOf": [ - { - "type": "array", - "items": { + "title": "Thing Description", + "version": "1.1-12-March-2025", + "description": "JSON Schema for validating TD instances against the TD information model. For a TD to validate this schema it must contain all the default terms defined in Section 5.4", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "anyUri": { "type": "string" - } }, - { - "type": "string" - } - ] - }, - "scopes": { - "oneOf": [ - { - "type": "array", - "items": { + "description": { "type": "string" - } }, - { - "type": "string" - } - ] - }, - "subprotocol": { - "type": "string", - "examples": ["longpoll", "websub", "sse"] - }, - "thing-context-td-uri-v1": { - "type": "string", - "const": "https://www.w3.org/2019/wot/td/v1" - }, - "thing-context-td-uri-v1.1": { - "type": "string", - "const": "https://www.w3.org/2022/wot/td/v1.1" - }, - "thing-context-td-uri-temp": { - "type": "string", - "const": "http://www.w3.org/ns/td" - }, - "thing-context": { - "anyOf": [ - { - "$comment": "New context URI with other vocabularies after it but not the old one", - "type": "array", - "items": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - } - ], - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ], - "not": { - "$ref": "#/definitions/thing-context-td-uri-v1" + "descriptions": { + "type": "object", + "additionalProperties": { + "type": "string" } - } }, - { - "$comment": "Only the new context URI", - "$ref": "#/definitions/thing-context-td-uri-v1.1" + "title": { + "type": "string" }, - { - "$comment": "Old context URI, followed by the new one and possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", - "type": "array", - "prefixItems": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1" - }, - { - "$ref": "#/definitions/thing-context-td-uri-v1.1" + "titles": { + "type": "object", + "additionalProperties": { + "type": "string" } - ], - "minItems": 2, - "contains": { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - }, - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ] - } }, - { - "$comment": "Old context URI, followed by possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", - "type": "array", - "prefixItems": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1" - } - ], - "minItems": 1, - "contains": { - "$ref": "#/definitions/thing-context-td-uri-v1" - }, - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } + "security": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } ] - } }, - { - "$comment": "Only the new context URI", - "$ref": "#/definitions/thing-context-td-uri-v1" - } - ] - }, - "type_declaration": { - "oneOf": [ - { - "type": "string", - "not": { - "const": "tm:ThingModel" - } + "scopes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] }, - { - "type": "array", - "items": { + "subprotocol": { "type": "string", - "not": { - "const": "tm:ThingModel" - } - } - } - ] - }, - "dataSchema-type": { - "type": "string", - "enum": [ - "boolean", - "integer", - "number", - "string", - "object", - "array", - "null" - ] - }, - "dataSchema": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "title": { - "$ref": "#/definitions/title" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "writeOnly": { - "type": "boolean" - }, - "readOnly": { - "type": "boolean" - }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } + "examples": ["longpoll", "websub", "sse"] }, - "unit": { - "type": "string" + "thing-context-td-uri-v1": { + "type": "string", + "const": "https://www.w3.org/2019/wot/td/v1" }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true + "thing-context-td-uri-v1.1": { + "type": "string", + "const": "https://www.w3.org/2022/wot/td/v1.1" }, - "format": { - "type": "string" + "thing-context-td-uri-temp": { + "type": "string", + "const": "http://www.w3.org/ns/td" }, - "const": {}, - "default": {}, - "contentEncoding": { - "type": "string" + "thing-context": { + "anyOf": [ + { + "$comment": "New context URI with other vocabularies after it but not the old one", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1.1" + } + ], + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ], + "not": { + "$ref": "#/definitions/thing-context-td-uri-v1" + } + } + }, + { + "$comment": "Only the new context URI", + "$ref": "#/definitions/thing-context-td-uri-v1.1" + }, + { + "$comment": "Old context URI, followed by the new one and possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1" + }, + { + "$ref": "#/definitions/thing-context-td-uri-v1.1" + } + ], + "minItems": 2, + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ] + } + }, + { + "$comment": "Old context URI, followed by possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1" + } + ], + "minItems": 1, + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ] + } + }, + { + "$comment": "Only the old context URI", + "$ref": "#/definitions/thing-context-td-uri-v1" + } + ] }, - "contentMediaType": { - "type": "string" + "type_declaration": { + "oneOf": [ + { + "type": "string", + "not": { + "const": "tm:ThingModel" + } + }, + { + "type": "array", + "items": { + "type": "string", + "not": { + "const": "tm:ThingModel" + } + } + } + ] }, - "type": { - "$ref": "#/definitions/dataSchema-type" + "dataSchema-type": { + "type": "string", + "enum": ["boolean", "integer", "number", "string", "object", "array", "null"] }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/dataSchema" + "dataSchema": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "title": { + "$ref": "#/definitions/title" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "writeOnly": { + "type": "boolean" + }, + "readOnly": { + "type": "boolean" + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + }, + "unit": { + "type": "string" + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "format": { + "type": "string" + }, + "const": {}, + "default": {}, + "contentEncoding": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/dataSchema-type" + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/dataSchema" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + } + ] + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minLength": { + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "multipleOf": { + "$ref": "#/definitions/multipleOfDefinition" + }, + "properties": { + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } }, - { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } + "required": ["readOnly", "writeOnly"] + }, + "additionalResponsesDefinition": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contentType": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "success": { + "type": "boolean" + } + }, + "required": ["contentType", "success"] } - ] - }, - "maxItems": { - "type": "integer", - "minimum": 0 - }, - "minItems": { - "type": "integer", - "minimum": 0 - }, - "minimum": { - "type": "number" }, - "maximum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minLength": { - "type": "integer", - "minimum": 0 - }, - "maxLength": { - "type": "integer", - "minimum": 0 - }, - "multipleOf": { - "$ref": "#/definitions/multipleOfDefinition" - }, - "properties": { - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["readOnly", "writeOnly"] - }, - "additionalResponsesDefinition": { - "type": "array", - "items": { - "type": "object", - "properties": { - "contentType": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "success": { - "type": "boolean" - } + "multipleOfDefinition": { + "type": ["integer", "number"], + "exclusiveMinimum": 0 }, - "required": ["contentType", "success"] - } - }, - "multipleOfDefinition": { - "type": ["integer", "number"], - "exclusiveMinimum": 0 - }, - "expectedResponse": { - "type": "object", - "properties": { - "contentType": { - "type": "string" - } - } - }, - "form_element_base": { - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } + "expectedResponse": { + "type": "object", + "properties": { + "contentType": { + "type": "string" + } } - ] - }, - "href": { - "$ref": "#/definitions/anyUri" - }, - "contentType": { - "type": "string" - }, - "contentCoding": { - "type": "string" - }, - "subprotocol": { - "$ref": "#/definitions/subprotocol" - }, - "security": { - "$ref": "#/definitions/security" }, - "scopes": { - "$ref": "#/definitions/scopes" - }, - "response": { - "$ref": "#/definitions/expectedResponse" - }, - "additionalResponses": { - "$ref": "#/definitions/additionalResponsesDefinition" - } - }, - "required": ["href", "contentType", "op"], - "additionalProperties": true - }, - "form_element_property": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": [ - "readproperty", - "writeproperty", - "observeproperty", - "unobserveproperty" - ] - }, - { - "type": "array", - "items": { - "type": "string", - "enum": [ - "readproperty", - "writeproperty", - "observeproperty", - "unobserveproperty" - ] - } - } - ] - } - }, - "additionalProperties": true - }, - "form_element_action": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": ["invokeaction", "queryaction", "cancelaction"] - }, - { - "type": "array", - "items": { - "type": "string", - "enum": ["invokeaction", "queryaction", "cancelaction"] - } - } - ] - } - }, - "additionalProperties": true - }, - "form_element_event": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": ["subscribeevent", "unsubscribeevent"] + "form_element_base": { + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "href": { + "$ref": "#/definitions/anyUri" + }, + "contentType": { + "type": "string" + }, + "contentCoding": { + "type": "string" + }, + "subprotocol": { + "$ref": "#/definitions/subprotocol" + }, + "security": { + "$ref": "#/definitions/security" + }, + "scopes": { + "$ref": "#/definitions/scopes" + }, + "response": { + "$ref": "#/definitions/expectedResponse" + }, + "additionalResponses": { + "$ref": "#/definitions/additionalResponsesDefinition" + } }, - { - "type": "array", - "items": { - "type": "string", - "enum": ["subscribeevent", "unsubscribeevent"] - } - } - ] - } - }, - "additionalProperties": true - }, - "form_element_root": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": [ - "readallproperties", - "writeallproperties", - "readmultipleproperties", - "writemultipleproperties", - "observeallproperties", - "unobserveallproperties", - "queryallactions", - "subscribeallevents", - "unsubscribeallevents" - ] + "required": ["href", "contentType", "op"], + "additionalProperties": true + }, + "form_element_property": { + "allOf": [ + { + "$ref": "#/definitions/form_element_base" + } + ], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "enum": ["readproperty", "writeproperty", "observeproperty", "unobserveproperty"] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": ["readproperty", "writeproperty", "observeproperty", "unobserveproperty"] + }, + "minItems": 1 + } + ] + } }, - { - "type": "array", - "items": { - "type": "string", - "enum": [ - "readallproperties", - "writeallproperties", - "readmultipleproperties", - "writemultipleproperties", - "observeallproperties", - "unobserveallproperties", - "queryallactions", - "subscribeallevents", - "unsubscribeallevents" - ] - } - } - ] - } - }, - "additionalProperties": true - }, - "form": { - "$comment": "This is NOT for validation purposes but for automatic generation of TS types. For more info, please see: https://github.com/w3c/wot-thing-description/pull/1319#issuecomment-994950057", - "oneOf": [ - { - "$ref": "#/definitions/form_element_property" - }, - { - "$ref": "#/definitions/form_element_action" - }, - { - "$ref": "#/definitions/form_element_event" - }, - { - "$ref": "#/definitions/form_element_root" - } - ] - }, - "property_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "additionalProperties": true }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_property" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "observable": { - "type": "boolean" - }, - "writeOnly": { - "type": "boolean" - }, - "readOnly": { - "type": "boolean" - }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - }, - "unit": { - "type": "string" - }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "format": { - "type": "string" - }, - "const": {}, - "default": {}, - "type": { - "$ref": "#/definitions/dataSchema-type" - }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/dataSchema" + "form_element_action": { + "allOf": [ + { + "$ref": "#/definitions/form_element_base" + } + ], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "enum": ["invokeaction", "queryaction", "cancelaction"] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": ["invokeaction", "queryaction", "cancelaction"] + }, + "minItems": 1 + } + ] + } }, - { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - } - ] - }, - "maxItems": { - "type": "integer", - "minimum": 0 + "additionalProperties": true }, - "minItems": { - "type": "integer", - "minimum": 0 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minLength": { - "type": "integer", - "minimum": 0 - }, - "maxLength": { - "type": "integer", - "minimum": 0 - }, - "multipleOf": { - "$ref": "#/definitions/multipleOfDefinition" - }, - "properties": { - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["forms", "readOnly", "writeOnly", "observable"], - "additionalProperties": true - }, - "action_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_action" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "input": { - "$ref": "#/definitions/dataSchema" - }, - "output": { - "$ref": "#/definitions/dataSchema" - }, - "safe": { - "type": "boolean" - }, - "idempotent": { - "type": "boolean" - }, - "synchronous": { - "type": "boolean" - } - }, - "required": ["forms", "safe", "idempotent"], - "additionalProperties": true - }, - "event_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_event" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "subscription": { - "$ref": "#/definitions/dataSchema" - }, - "data": { - "$ref": "#/definitions/dataSchema" - }, - "dataResponse": { - "$ref": "#/definitions/dataSchema" - }, - "cancellation": { - "$ref": "#/definitions/dataSchema" - } - }, - "required": ["forms"], - "additionalProperties": true - }, - "base_link_element": { - "type": "object", - "properties": { - "href": { - "$ref": "#/definitions/anyUri" - }, - "type": { - "type": "string" - }, - "rel": { - "type": "string" - }, - "anchor": { - "$ref": "#/definitions/anyUri" - } - }, - "required": ["href"], - "additionalProperties": true - }, - "link_element": { - "allOf": [ - { - "$ref": "#/definitions/base_link_element" - }, - { - "not": { - "description": "A basic link element should not contain sizes", + "form_element_event": { + "allOf": [ + { + "$ref": "#/definitions/form_element_base" + } + ], "type": "object", "properties": { - "sizes": {} + "op": { + "oneOf": [ + { + "type": "string", + "enum": ["subscribeevent", "unsubscribeevent"] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": ["subscribeevent", "unsubscribeevent"] + }, + "minItems": 1 + } + ] + } }, - "required": ["sizes"] - } + "additionalProperties": true }, - { - "not": { - "description": "A basic link element should not contain icon or tm:extends", + "form_element_root": { + "allOf": [ + { + "$ref": "#/definitions/form_element_base" + } + ], + "type": "object", "properties": { - "rel": { - "enum": ["icon", "tm:extends"] - } + "op": { + "oneOf": [ + { + "type": "string", + "enum": [ + "readallproperties", + "writeallproperties", + "readmultipleproperties", + "writemultipleproperties", + "observeallproperties", + "unobserveallproperties", + "queryallactions", + "subscribeallevents", + "unsubscribeallevents" + ] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "readallproperties", + "writeallproperties", + "readmultipleproperties", + "writemultipleproperties", + "observeallproperties", + "unobserveallproperties", + "queryallactions", + "subscribeallevents", + "unsubscribeallevents" + ] + }, + "minItems": 1 + } + ] + } }, - "required": ["rel"] - } - } - ] - }, - "icon_link_element": { - "allOf": [ - { - "$ref": "#/definitions/base_link_element" + "additionalProperties": true + }, + "form": { + "$comment": "This is NOT for validation purposes but for automatic generation of TS types. For more info, please see: https://github.com/w3c/wot-thing-description/pull/1319#issuecomment-994950057", + "oneOf": [ + { + "$ref": "#/definitions/form_element_property" + }, + { + "$ref": "#/definitions/form_element_action" + }, + { + "$ref": "#/definitions/form_element_event" + }, + { + "$ref": "#/definitions/form_element_root" + } + ] }, - { - "properties": { - "rel": { - "const": "icon" + "property_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_property" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "observable": { + "type": "boolean" + }, + "writeOnly": { + "type": "boolean" + }, + "readOnly": { + "type": "boolean" + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + }, + "unit": { + "type": "string" + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "format": { + "type": "string" + }, + "const": {}, + "default": {}, + "type": { + "$ref": "#/definitions/dataSchema-type" + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/dataSchema" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + } + ] + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minLength": { + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "multipleOf": { + "$ref": "#/definitions/multipleOfDefinition" + }, + "properties": { + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } }, - "sizes": { - "type": "string", - "pattern": "[0-9]*x[0-9]+" - } - }, - "required": ["rel"] - } - ] - }, - "additionalSecurityScheme": { - "description": "Applies to additional SecuritySchemes not defined in the WoT TD specification.", - "$comment": "Additional SecuritySchemes should always be defined via a context extension, using a prefixed value for the scheme. This prefix (e.g. 'ace', see the example below) must contain at least one character in order to reference a valid JSON-LD context extension.", - "examples": [ - { - "scheme": "ace:ACESecurityScheme", - "ace:as": "coaps://as.example.com/token", - "ace:audience": "coaps://rs.example.com", - "ace:scopes": ["limited", "special"], - "ace:cnonce": true - } - ], - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "pattern": ".+:.*" - } - }, - "required": ["scheme"] - }, - "noSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["nosec"] - } - }, - "required": ["scheme"] - }, - "autoSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" + "required": ["forms", "readOnly", "writeOnly", "observable"], + "additionalProperties": true }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["auto"] - } - }, - "required": ["scheme"] - }, - "comboSecurityScheme": { - "oneOf": [ - { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["combo"] + "action_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_action" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "input": { + "$ref": "#/definitions/dataSchema" + }, + "output": { + "$ref": "#/definitions/dataSchema" + }, + "safe": { + "type": "boolean" + }, + "idempotent": { + "type": "boolean" + }, + "synchronous": { + "type": "boolean" + } }, - "oneOf": { - "type": "array", - "minItems": 2, - "items": { - "type": "string" - } - } - }, - "required": ["scheme", "oneOf"] + "required": ["forms", "safe", "idempotent"], + "additionalProperties": true }, - { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["combo"] + "event_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_event" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "subscription": { + "$ref": "#/definitions/dataSchema" + }, + "data": { + "$ref": "#/definitions/dataSchema" + }, + "dataResponse": { + "$ref": "#/definitions/dataSchema" + }, + "cancellation": { + "$ref": "#/definitions/dataSchema" + } }, - "allOf": { - "type": "array", - "minItems": 2, - "items": { - "type": "string" - } - } - }, - "required": ["scheme", "allOf"] - } - ] - }, - "basicSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["basic"] - }, - "in": { - "type": "string", - "enum": ["header", "query", "body", "cookie", "auto"] - }, - "name": { - "type": "string" - } - }, - "required": ["scheme", "in"] - }, - "digestSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "required": ["forms"], + "additionalProperties": true }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["digest"] - }, - "qop": { - "type": "string", - "enum": ["auth", "auth-int"] - }, - "in": { - "type": "string", - "enum": ["header", "query", "body", "cookie", "auto"] - }, - "name": { - "type": "string" - } - }, - "required": ["scheme", "in", "qop"] - }, - "apiKeySecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["apikey"] - }, - "in": { - "type": "string", - "enum": [ - "header", - "query", - "body", - "uri", - "auto", - "cookie" - ] + "base_link_element": { + "type": "object", + "properties": { + "href": { + "$ref": "#/definitions/anyUri" + }, + "type": { + "type": "string" + }, + "rel": { + "type": "string" + }, + "anchor": { + "$ref": "#/definitions/anyUri" + } + }, + "required": ["href"], + "additionalProperties": true + }, + "link_element": { + "allOf": [ + { + "$ref": "#/definitions/base_link_element" + }, + { + "not": { + "description": "A basic link element should not contain sizes", + "type": "object", + "properties": { + "sizes": {} + }, + "required": ["sizes"] + } + }, + { + "not": { + "description": "A basic link element should not contain icon or tm:extends", + "properties": { + "rel": { + "enum": ["icon", "tm:extends"] + } + }, + "required": ["rel"] + } + } + ] }, - "name": { - "type": "string" - } - }, - "required": ["scheme", "in"] - }, - "bearerSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "icon_link_element": { + "allOf": [ + { + "$ref": "#/definitions/base_link_element" + }, + { + "properties": { + "rel": { + "const": "icon" + }, + "sizes": { + "type": "string", + "pattern": "[0-9]*x[0-9]+" + } + }, + "required": ["rel"] + } + ] }, - "description": { - "$ref": "#/definitions/description" + "additionalSecurityScheme": { + "description": "Applies to additional SecuritySchemes not defined in the WoT TD specification.", + "$comment": "Additional SecuritySchemes should always be defined via a context extension, using a prefixed value for the scheme. This prefix (e.g. 'ace', see the example below) must contain at least one character in order to reference a valid JSON-LD context extension.", + "examples": [ + { + "scheme": "ace:ACESecurityScheme", + "ace:as": "coaps://as.example.com/token", + "ace:audience": "coaps://rs.example.com", + "ace:scopes": ["limited", "special"], + "ace:cnonce": true + } + ], + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "pattern": ".+:.*" + } + }, + "required": ["scheme"] }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "noSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["nosec"] + } + }, + "required": ["scheme"] }, - "proxy": { - "$ref": "#/definitions/anyUri" + "autoSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["auto"] + } + }, + "required": ["scheme"] + }, + "comboSecurityScheme": { + "oneOf": [ + { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["combo"] + }, + "oneOf": { + "type": "array", + "minItems": 2, + "items": { + "type": "string" + } + } + }, + "required": ["scheme", "oneOf"] + }, + { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["combo"] + }, + "allOf": { + "type": "array", + "minItems": 2, + "items": { + "type": "string" + } + } + }, + "required": ["scheme", "allOf"] + } + ] }, - "scheme": { - "type": "string", - "enum": ["bearer"] + "basicSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["basic"] + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "auto"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme", "in"] }, - "authorization": { - "$ref": "#/definitions/anyUri" + "digestSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["digest"] + }, + "qop": { + "type": "string", + "enum": ["auth", "auth-int"] + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "auto"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme", "in", "qop"] }, - "alg": { - "type": "string" + "apiKeySecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["apikey"] + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "uri", "auto", "cookie"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme", "in"] }, - "format": { - "type": "string" + "bearerSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["bearer"] + }, + "authorization": { + "$ref": "#/definitions/anyUri" + }, + "alg": { + "type": "string" + }, + "format": { + "type": "string" + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "auto"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme", "alg", "format", "in"] }, - "in": { - "type": "string", - "enum": ["header", "query", "body", "cookie", "auto"] + "pskSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["psk"] + }, + "identity": { + "type": "string" + } + }, + "required": ["scheme"] }, - "name": { - "type": "string" + "oAuth2SecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["oauth2"] + }, + "authorization": { + "$ref": "#/definitions/anyUri" + }, + "token": { + "$ref": "#/definitions/anyUri" + }, + "refresh": { + "$ref": "#/definitions/anyUri" + }, + "scopes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "flow": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": ["code", "client", "device"] + } + ] + } + }, + "required": ["scheme"] + }, + "securityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/noSecurityScheme" + }, + { + "$ref": "#/definitions/autoSecurityScheme" + }, + { + "$ref": "#/definitions/comboSecurityScheme" + }, + { + "$ref": "#/definitions/basicSecurityScheme" + }, + { + "$ref": "#/definitions/digestSecurityScheme" + }, + { + "$ref": "#/definitions/apiKeySecurityScheme" + }, + { + "$ref": "#/definitions/bearerSecurityScheme" + }, + { + "$ref": "#/definitions/pskSecurityScheme" + }, + { + "$ref": "#/definitions/oAuth2SecurityScheme" + }, + { + "$ref": "#/definitions/additionalSecurityScheme" + } + ] } - }, - "required": ["scheme", "alg", "format", "in"] }, - "pskSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" }, - "description": { - "$ref": "#/definitions/description" + "title": { + "$ref": "#/definitions/title" }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "titles": { + "$ref": "#/definitions/titles" }, - "proxy": { - "$ref": "#/definitions/anyUri" + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/property_element" + } }, - "scheme": { - "type": "string", - "enum": ["psk"] + "actions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/action_element" + } }, - "identity": { - "type": "string" - } - }, - "required": ["scheme"] - }, - "oAuth2SecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "events": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/event_element" + } }, "description": { - "$ref": "#/definitions/description" + "$ref": "#/definitions/description" }, "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" + "$ref": "#/definitions/descriptions" }, - "scheme": { - "type": "string", - "enum": ["oauth2"] - }, - "authorization": { - "$ref": "#/definitions/anyUri" - }, - "token": { - "$ref": "#/definitions/anyUri" - }, - "refresh": { - "$ref": "#/definitions/anyUri" - }, - "scopes": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } + "version": { + "type": "object", + "properties": { + "instance": { + "type": "string" + } }, - { - "type": "string" + "required": ["instance"] + }, + "links": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/link_element" + }, + { + "$ref": "#/definitions/icon_link_element" + } + ] } - ] }, - "flow": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": ["code", "client", "device"] + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_root" } - ] - } - }, - "required": ["scheme"] - }, - "securityScheme": { - "oneOf": [ - { - "$ref": "#/definitions/noSecurityScheme" }, - { - "$ref": "#/definitions/autoSecurityScheme" - }, - { - "$ref": "#/definitions/comboSecurityScheme" + "base": { + "$ref": "#/definitions/anyUri" }, - { - "$ref": "#/definitions/basicSecurityScheme" + "securityDefinitions": { + "type": "object", + "minProperties": 1, + "additionalProperties": { + "$ref": "#/definitions/securityScheme" + } }, - { - "$ref": "#/definitions/digestSecurityScheme" + "schemaDefinitions": { + "type": "object", + "minProperties": 1, + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } }, - { - "$ref": "#/definitions/apiKeySecurityScheme" + "support": { + "$ref": "#/definitions/anyUri" }, - { - "$ref": "#/definitions/bearerSecurityScheme" + "created": { + "type": "string", + "format": "date-time" }, - { - "$ref": "#/definitions/pskSecurityScheme" + "modified": { + "type": "string", + "format": "date-time" + }, + "profile": { + "oneOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/anyUri" + } + } + ] }, - { - "$ref": "#/definitions/oAuth2SecurityScheme" + "security": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/additionalSecurityScheme" - } - ] - } - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uri" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/property_element" - } - }, - "actions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/action_element" - } - }, - "events": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/event_element" - } - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "version": { - "type": "object", - "properties": { - "instance": { - "type": "string" - } - }, - "required": ["instance"] - }, - "links": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/link_element" - }, - { - "$ref": "#/definitions/icon_link_element" - } - ] - } - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_root" - } - }, - "base": { - "$ref": "#/definitions/anyUri" - }, - "securityDefinitions": { - "type": "object", - "minProperties": 1, - "additionalProperties": { - "$ref": "#/definitions/securityScheme" - } - }, - "schemaDefinitions": { - "type": "object", - "minProperties": 1, - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "support": { - "$ref": "#/definitions/anyUri" - }, - "created": { - "type": "string", - "format": "date-time" - }, - "modified": { - "type": "string", - "format": "date-time" - }, - "profile": { - "oneOf": [ - { - "$ref": "#/definitions/anyUri" + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } }, - { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/anyUri" - } - } - ] - }, - "security": { - "oneOf": [ - { - "type": "string" + "@type": { + "$ref": "#/definitions/type_declaration" }, - { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } + "@context": { + "$ref": "#/definitions/thing-context" } - ] - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "@type": { - "$ref": "#/definitions/type_declaration" }, - "@context": { - "$ref": "#/definitions/thing-context" - } - }, - "required": ["title", "security", "securityDefinitions", "@context"], - "additionalProperties": true + "required": ["title", "security", "securityDefinitions", "@context"], + "additionalProperties": true } diff --git a/src/external/td-schema.json b/src/external/td-schema.json index 22c1a276..0575d647 100644 --- a/src/external/td-schema.json +++ b/src/external/td-schema.json @@ -1,1328 +1,1318 @@ { - "title": "Thing Description", - "version": "1.1-05-September-2022", - "description": "JSON Schema for validating TD instances against the TD information model. TD instances can be with or without terms that have default values", - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/w3c/wot-thing-description/main/validation/td-json-schema-validation.json", - "definitions": { - "anyUri": { - "type": "string" - }, - "description": { - "type": "string" - }, - "descriptions": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "title": { - "type": "string" - }, - "titles": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "security": { - "oneOf": [ - { - "type": "array", - "items": { + "title": "Thing Description", + "version": "1.1-12-March-2025", + "description": "JSON Schema for validating TD instances against the TD information model. TD instances can be with or without terms that have default values", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/w3c/wot-thing-description/main/validation/td-json-schema-validation.json", + "definitions": { + "anyUri": { "type": "string" - }, - "minItems": 1 }, - { - "type": "string" - } - ] - }, - "scopes": { - "oneOf": [ - { - "type": "array", - "items": { + "description": { "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "subprotocol": { - "type": "string", - "examples": ["longpoll", "websub", "sse"] - }, - "thing-context-td-uri-v1": { - "type": "string", - "const": "https://www.w3.org/2019/wot/td/v1" - }, - "thing-context-td-uri-v1.1": { - "type": "string", - "const": "https://www.w3.org/2022/wot/td/v1.1" - }, - "thing-context-td-uri-temp": { - "type": "string", - "const": "http://www.w3.org/ns/td" - }, - "thing-context": { - "anyOf": [ - { - "$comment": "New context URI with other vocabularies after it but not the old one", - "type": "array", - "items": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - } - ], - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ], - "not": { - "$ref": "#/definitions/thing-context-td-uri-v1" - } - } - }, - { - "$comment": "Only the new context URI", - "$ref": "#/definitions/thing-context-td-uri-v1.1" - }, - { - "$comment": "Old context URI, followed by the new one and possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", - "type": "array", - "prefixItems": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1" - }, - { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - } - ], - "minItems": 2, - "contains": { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - }, - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ] - } }, - { - "$comment": "Old context URI, followed by possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", - "type": "array", - "prefixItems": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1" - } - ], - "minItems": 1, - "contains": { - "$ref": "#/definitions/thing-context-td-uri-v1" - }, - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ] - } - }, - { - "$comment": "Only the new context URI", - "$ref": "#/definitions/thing-context-td-uri-v1" - } - ] - }, - "bcp47_string": { - "type": "string", - "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" - }, - "type_declaration": { - "oneOf": [ - { - "type": "string", - "not": { - "const": "tm:ThingModel" - } - }, - { - "type": "array", - "items": { - "type": "string", - "not": { - "const": "tm:ThingModel" + "descriptions": { + "type": "object", + "additionalProperties": { + "type": "string" } - } - } - ] - }, - "dataSchema-type": { - "type": "string", - "enum": [ - "boolean", - "integer", - "number", - "string", - "object", - "array", - "null" - ] - }, - "dataSchema": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" }, "title": { - "$ref": "#/definitions/title" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "type": "string" }, "titles": { - "$ref": "#/definitions/titles" - }, - "writeOnly": { - "type": "boolean" - }, - "readOnly": { - "type": "boolean" - }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - }, - "unit": { - "type": "string" - }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "format": { - "type": "string" - }, - "const": {}, - "default": {}, - "contentEncoding": { - "type": "string" - }, - "contentMediaType": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/dataSchema-type" - }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/dataSchema" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - } - ] - }, - "maxItems": { - "type": "integer", - "minimum": 0 - }, - "minItems": { - "type": "integer", - "minimum": 0 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minLength": { - "type": "integer", - "minimum": 0 - }, - "maxLength": { - "type": "integer", - "minimum": 0 - }, - "multipleOf": { - "$ref": "#/definitions/multipleOfDefinition" - }, - "properties": { - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "additionalResponsesDefinition": { - "type": "array", - "items": { - "type": "object", - "properties": { - "contentType": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - } - }, - "multipleOfDefinition": { - "type": ["integer", "number"], - "exclusiveMinimum": 0 - }, - "expectedResponse": { - "type": "object", - "properties": { - "contentType": { - "type": "string" - } - } - }, - "form_element_base": { - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { + "type": "object", + "additionalProperties": { "type": "string" - } } - ] - }, - "href": { - "$ref": "#/definitions/anyUri" - }, - "contentType": { - "type": "string" - }, - "contentCoding": { - "type": "string" - }, - "subprotocol": { - "$ref": "#/definitions/subprotocol" }, "security": { - "$ref": "#/definitions/security" + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + { + "type": "string" + } + ] }, "scopes": { - "$ref": "#/definitions/scopes" - }, - "response": { - "$ref": "#/definitions/expectedResponse" - }, - "additionalResponses": { - "$ref": "#/definitions/additionalResponsesDefinition" - } - }, - "required": ["href"], - "additionalProperties": true - }, - "form_element_property": { - "allOf": [{ "$ref": "#/definitions/form_element_base" }], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": [ - "readproperty", - "writeproperty", - "observeproperty", - "unobserveproperty" - ] - }, - { - "type": "array", - "items": { - "type": "string", - "enum": [ - "readproperty", - "writeproperty", - "observeproperty", - "unobserveproperty" - ] - } - } - ] - } - }, - "additionalProperties": true - }, - "form_element_action": { - "allOf": [{ "$ref": "#/definitions/form_element_base" }], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": ["invokeaction", "queryaction", "cancelaction"] - }, - { - "type": "array", - "items": { - "type": "string", - "enum": ["invokeaction", "queryaction", "cancelaction"] - } - } - ] - } - }, - "additionalProperties": true - }, - "form_element_event": { - "allOf": [{ "$ref": "#/definitions/form_element_base" }], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": ["subscribeevent", "unsubscribeevent"] - }, - { - "type": "array", - "items": { - "type": "string", - "enum": ["subscribeevent", "unsubscribeevent"] - } - } - ] - } - }, - "additionalProperties": true - }, - "form_element_root": { - "allOf": [{ "$ref": "#/definitions/form_element_base" }], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "enum": [ - "readallproperties", - "writeallproperties", - "readmultipleproperties", - "writemultipleproperties", - "observeallproperties", - "unobserveallproperties", - "queryallactions", - "subscribeallevents", - "unsubscribeallevents" - ] - }, - { - "type": "array", - "items": { - "type": "string", - "enum": [ - "readallproperties", - "writeallproperties", - "readmultipleproperties", - "writemultipleproperties", - "observeallproperties", - "unobserveallproperties", - "queryallactions", - "subscribeallevents", - "unsubscribeallevents" - ] - } - } - ] - } - }, - "additionalProperties": true, - "required": ["op"] - }, - "form": { - "$comment": "This is NOT for validation purposes but for automatic generation of TS types. For more info, please see: https://github.com/w3c/wot-thing-description/pull/1319#issuecomment-994950057", - "oneOf": [ - { "$ref": "#/definitions/form_element_property" }, - { "$ref": "#/definitions/form_element_action" }, - { "$ref": "#/definitions/form_element_event" }, - { "$ref": "#/definitions/form_element_root" } - ] - }, - "property_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_property" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "observable": { - "type": "boolean" + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] }, - "writeOnly": { - "type": "boolean" + "subprotocol": { + "type": "string", + "examples": ["longpoll", "websub", "sse"] }, - "readOnly": { - "type": "boolean" + "thing-context-td-uri-v1": { + "type": "string", + "const": "https://www.w3.org/2019/wot/td/v1" }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } + "thing-context-td-uri-v1.1": { + "type": "string", + "const": "https://www.w3.org/2022/wot/td/v1.1" }, - "unit": { - "type": "string" + "thing-context-td-uri-temp": { + "type": "string", + "const": "http://www.w3.org/ns/td" }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true + "thing-context": { + "anyOf": [ + { + "$comment": "New context URI with other vocabularies after it but not the old one", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1.1" + } + ], + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ], + "not": { + "$ref": "#/definitions/thing-context-td-uri-v1" + } + } + }, + { + "$comment": "Only the new context URI", + "$ref": "#/definitions/thing-context-td-uri-v1.1" + }, + { + "$comment": "Old context URI, followed by the new one and possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1" + }, + { + "$ref": "#/definitions/thing-context-td-uri-v1.1" + } + ], + "minItems": 2, + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ] + } + }, + { + "$comment": "Old context URI, followed by possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1" + } + ], + "minItems": 1, + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ] + } + }, + { + "$comment": "Only the old context URI", + "$ref": "#/definitions/thing-context-td-uri-v1" + } + ] }, - "format": { - "type": "string" + "bcp47_string": { + "type": "string", + "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" + }, + "type_declaration": { + "oneOf": [ + { + "type": "string", + "not": { + "const": "tm:ThingModel" + } + }, + { + "type": "array", + "items": { + "type": "string", + "not": { + "const": "tm:ThingModel" + } + } + } + ] }, - "const": {}, - "default": {}, - "type": { - "$ref": "#/definitions/dataSchema-type" + "dataSchema-type": { + "type": "string", + "enum": ["boolean", "integer", "number", "string", "object", "array", "null"] }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/dataSchema" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } + "dataSchema": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "title": { + "$ref": "#/definitions/title" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "writeOnly": { + "type": "boolean" + }, + "readOnly": { + "type": "boolean" + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + }, + "unit": { + "type": "string" + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "format": { + "type": "string" + }, + "const": {}, + "default": {}, + "contentEncoding": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/dataSchema-type" + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/dataSchema" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + } + ] + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minLength": { + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "multipleOf": { + "$ref": "#/definitions/multipleOfDefinition" + }, + "properties": { + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } } - ] - }, - "maxItems": { - "type": "integer", - "minimum": 0 - }, - "minItems": { - "type": "integer", - "minimum": 0 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minLength": { - "type": "integer", - "minimum": 0 - }, - "maxLength": { - "type": "integer", - "minimum": 0 - }, - "multipleOf": { - "$ref": "#/definitions/multipleOfDefinition" - }, - "properties": { - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["forms"], - "additionalProperties": true - }, - "action_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_action" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "input": { - "$ref": "#/definitions/dataSchema" - }, - "output": { - "$ref": "#/definitions/dataSchema" - }, - "safe": { - "type": "boolean" - }, - "idempotent": { - "type": "boolean" - }, - "synchronous": { - "type": "boolean" - } - }, - "required": ["forms"], - "additionalProperties": true - }, - "event_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_event" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "subscription": { - "$ref": "#/definitions/dataSchema" - }, - "data": { - "$ref": "#/definitions/dataSchema" - }, - "dataResponse": { - "$ref": "#/definitions/dataSchema" - }, - "cancellation": { - "$ref": "#/definitions/dataSchema" - } - }, - "required": ["forms"], - "additionalProperties": true - }, - "base_link_element": { - "type": "object", - "properties": { - "href": { - "$ref": "#/definitions/anyUri" - }, - "type": { - "type": "string" - }, - "rel": { - "type": "string" - }, - "anchor": { - "$ref": "#/definitions/anyUri" - }, - "hreflang": { - "anyOf": [ - { "$ref": "#/definitions/bcp47_string" }, - { - "type": "array", - "items": { - "$ref": "#/definitions/bcp47_string" - } + "additionalResponsesDefinition": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contentType": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } } - ] - } - }, - "required": ["href"], - "additionalProperties": true - }, - "link_element": { - "allOf": [ - { - "$ref": "#/definitions/base_link_element" }, - { - "not": { - "description": "A basic link element should not contain sizes", + "multipleOfDefinition": { + "type": ["integer", "number"], + "exclusiveMinimum": 0 + }, + "expectedResponse": { "type": "object", "properties": { - "sizes": {} + "contentType": { + "type": "string" + } }, - "required": ["sizes"] - } + "required": ["contentType"] }, - { - "not": { - "description": "A basic link element should not contain icon or tm:extends", + "form_element_base": { + "type": "object", "properties": { - "rel": { - "enum": ["icon", "tm:extends"] - } + "op": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "href": { + "$ref": "#/definitions/anyUri" + }, + "contentType": { + "type": "string" + }, + "contentCoding": { + "type": "string" + }, + "subprotocol": { + "$ref": "#/definitions/subprotocol" + }, + "security": { + "$ref": "#/definitions/security" + }, + "scopes": { + "$ref": "#/definitions/scopes" + }, + "response": { + "$ref": "#/definitions/expectedResponse" + }, + "additionalResponses": { + "$ref": "#/definitions/additionalResponsesDefinition" + } }, - "required": ["rel"] - } - } - ] - }, - "icon_link_element": { - "allOf": [ - { - "$ref": "#/definitions/base_link_element" + "required": ["href"], + "additionalProperties": true }, - { - "properties": { - "rel": { - "const": "icon" + "form_element_property": { + "allOf": [{ "$ref": "#/definitions/form_element_base" }], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "enum": ["readproperty", "writeproperty", "observeproperty", "unobserveproperty"] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": ["readproperty", "writeproperty", "observeproperty", "unobserveproperty"] + }, + "minItems": 1 + } + ] + } }, - "sizes": { - "type": "string", - "pattern": "[0-9]*x[0-9]+" - } - }, - "required": ["rel"] - } - ] - }, - "additionalSecurityScheme": { - "description": "Applies to additional SecuritySchemes not defined in the WoT TD specification.", - "$comment": "Additional SecuritySchemes should always be defined via a context extension, using a prefixed value for the scheme. This prefix (e.g. 'ace', see the example below) must contain at least one character in order to reference a valid JSON-LD context extension.", - "examples": [ - { - "scheme": "ace:ACESecurityScheme", - "ace:as": "coaps://as.example.com/token", - "ace:audience": "coaps://rs.example.com", - "ace:scopes": ["limited", "special"], - "ace:cnonce": true - } - ], - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" + "additionalProperties": true }, - "scheme": { - "type": "string", - "pattern": ".+:.*" - } - }, - "required": ["scheme"], - "additionalProperties": true - }, - "noSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "form_element_action": { + "allOf": [{ "$ref": "#/definitions/form_element_base" }], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "enum": ["invokeaction", "queryaction", "cancelaction"] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": ["invokeaction", "queryaction", "cancelaction"] + }, + "minItems": 1 + } + ] + } + }, + "additionalProperties": true }, - "description": { - "$ref": "#/definitions/description" + "form_element_event": { + "allOf": [{ "$ref": "#/definitions/form_element_base" }], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "enum": ["subscribeevent", "unsubscribeevent"] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": ["subscribeevent", "unsubscribeevent"] + }, + "minItems": 1 + } + ] + } + }, + "additionalProperties": true }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "form_element_root": { + "allOf": [{ "$ref": "#/definitions/form_element_base" }], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "enum": [ + "readallproperties", + "writeallproperties", + "readmultipleproperties", + "writemultipleproperties", + "observeallproperties", + "unobserveallproperties", + "queryallactions", + "subscribeallevents", + "unsubscribeallevents" + ] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "readallproperties", + "writeallproperties", + "readmultipleproperties", + "writemultipleproperties", + "observeallproperties", + "unobserveallproperties", + "queryallactions", + "subscribeallevents", + "unsubscribeallevents" + ] + }, + "minItems": 1 + } + ] + } + }, + "additionalProperties": true, + "required": ["op"] + }, + "form": { + "$comment": "This is NOT for validation purposes but for automatic generation of TS types. For more info, please see: https://github.com/w3c/wot-thing-description/pull/1319#issuecomment-994950057", + "oneOf": [ + { "$ref": "#/definitions/form_element_property" }, + { "$ref": "#/definitions/form_element_action" }, + { "$ref": "#/definitions/form_element_event" }, + { "$ref": "#/definitions/form_element_root" } + ] }, - "proxy": { - "$ref": "#/definitions/anyUri" + "property_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_property" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "observable": { + "type": "boolean" + }, + "writeOnly": { + "type": "boolean" + }, + "readOnly": { + "type": "boolean" + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + }, + "unit": { + "type": "string" + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "format": { + "type": "string" + }, + "const": {}, + "default": {}, + "type": { + "$ref": "#/definitions/dataSchema-type" + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/dataSchema" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + } + ] + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minLength": { + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "multipleOf": { + "$ref": "#/definitions/multipleOfDefinition" + }, + "properties": { + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["forms"], + "additionalProperties": true }, - "scheme": { - "type": "string", - "enum": ["nosec"] - } - }, - "required": ["scheme"], - "additionalProperties": true - }, - "autoSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "action_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_action" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "input": { + "$ref": "#/definitions/dataSchema" + }, + "output": { + "$ref": "#/definitions/dataSchema" + }, + "safe": { + "type": "boolean" + }, + "idempotent": { + "type": "boolean" + }, + "synchronous": { + "type": "boolean" + } + }, + "required": ["forms"], + "additionalProperties": true }, - "description": { - "$ref": "#/definitions/description" + "event_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_event" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "subscription": { + "$ref": "#/definitions/dataSchema" + }, + "data": { + "$ref": "#/definitions/dataSchema" + }, + "dataResponse": { + "$ref": "#/definitions/dataSchema" + }, + "cancellation": { + "$ref": "#/definitions/dataSchema" + } + }, + "required": ["forms"], + "additionalProperties": true }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "base_link_element": { + "type": "object", + "properties": { + "href": { + "$ref": "#/definitions/anyUri" + }, + "type": { + "type": "string" + }, + "rel": { + "type": "string" + }, + "anchor": { + "$ref": "#/definitions/anyUri" + }, + "hreflang": { + "anyOf": [ + { "$ref": "#/definitions/bcp47_string" }, + { + "type": "array", + "items": { + "$ref": "#/definitions/bcp47_string" + } + } + ] + } + }, + "required": ["href"], + "additionalProperties": true + }, + "link_element": { + "allOf": [ + { + "$ref": "#/definitions/base_link_element" + }, + { + "not": { + "description": "A basic link element should not contain sizes", + "type": "object", + "properties": { + "sizes": {} + }, + "required": ["sizes"] + } + }, + { + "not": { + "description": "A basic link element should not contain icon or tm:extends", + "properties": { + "rel": { + "enum": ["icon", "tm:extends"] + } + }, + "required": ["rel"] + } + } + ] }, - "proxy": { - "$ref": "#/definitions/anyUri" + "icon_link_element": { + "allOf": [ + { + "$ref": "#/definitions/base_link_element" + }, + { + "properties": { + "rel": { + "const": "icon" + }, + "sizes": { + "type": "string", + "pattern": "[0-9]*x[0-9]+" + } + }, + "required": ["rel"] + } + ] }, - "scheme": { - "type": "string", - "enum": ["auto"] - } - }, - "not": { - "required": ["name"] - }, - "required": ["scheme"], - "additionalProperties": true - }, - "comboSecurityScheme": { - "oneOf": [ - { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["combo"] + "additionalSecurityScheme": { + "description": "Applies to additional SecuritySchemes not defined in the WoT TD specification.", + "$comment": "Additional SecuritySchemes should always be defined via a context extension, using a prefixed value for the scheme. This prefix (e.g. 'ace', see the example below) must contain at least one character in order to reference a valid JSON-LD context extension.", + "examples": [ + { + "scheme": "ace:ACESecurityScheme", + "ace:as": "coaps://as.example.com/token", + "ace:audience": "coaps://rs.example.com", + "ace:scopes": ["limited", "special"], + "ace:cnonce": true + } + ], + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "pattern": ".+:.*" + } }, - "oneOf": { - "type": "array", - "minItems": 2, - "items": { - "type": "string" - } - } - }, - "required": ["scheme", "oneOf"], - "additionalProperties": true + "required": ["scheme"], + "additionalProperties": true }, - { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "noSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["nosec"] + } }, - "proxy": { - "$ref": "#/definitions/anyUri" + "required": ["scheme"], + "additionalProperties": true + }, + "autoSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["auto"] + } }, - "scheme": { - "type": "string", - "enum": ["combo"] + "not": { + "required": ["name"] }, - "allOf": { - "type": "array", - "minItems": 2, - "items": { - "type": "string" - } - } - }, - "required": ["scheme", "allOf"], - "additionalProperties": true - } - ] - }, - "basicSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["basic"] - }, - "in": { - "type": "string", - "enum": ["header", "query", "body", "cookie", "auto"] - }, - "name": { - "type": "string" - } - }, - "required": ["scheme"], - "additionalProperties": true - }, - "digestSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["digest"] - }, - "qop": { - "type": "string", - "enum": ["auth", "auth-int"] - }, - "in": { - "type": "string", - "enum": ["header", "query", "body", "cookie", "auto"] - }, - "name": { - "type": "string" - } - }, - "required": ["scheme"], - "additionalProperties": true - }, - "apiKeySecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "enum": ["apikey"] - }, - "in": { - "type": "string", - "enum": ["header", "query", "body", "cookie", "uri", "auto"] - }, - "name": { - "type": "string" - } - }, - "required": ["scheme"], - "additionalProperties": true - }, - "bearerSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" + "required": ["scheme"], + "additionalProperties": true + }, + "comboSecurityScheme": { + "oneOf": [ + { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["combo"] + }, + "oneOf": { + "type": "array", + "minItems": 2, + "items": { + "type": "string" + } + } + }, + "required": ["scheme", "oneOf"], + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["combo"] + }, + "allOf": { + "type": "array", + "minItems": 2, + "items": { + "type": "string" + } + } + }, + "required": ["scheme", "allOf"], + "additionalProperties": true + } + ] }, - "scheme": { - "type": "string", - "enum": ["bearer"] + "basicSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["basic"] + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "auto"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme"], + "additionalProperties": true }, - "authorization": { - "$ref": "#/definitions/anyUri" + "digestSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["digest"] + }, + "qop": { + "type": "string", + "enum": ["auth", "auth-int"] + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "auto"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme"], + "additionalProperties": true }, - "alg": { - "type": "string" + "apiKeySecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["apikey"] + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "uri", "auto"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme"], + "additionalProperties": true }, - "format": { - "type": "string" + "bearerSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["bearer"] + }, + "authorization": { + "$ref": "#/definitions/anyUri" + }, + "alg": { + "type": "string" + }, + "format": { + "type": "string" + }, + "in": { + "type": "string", + "enum": ["header", "query", "body", "cookie", "auto"] + }, + "name": { + "type": "string" + } + }, + "required": ["scheme"], + "additionalProperties": true }, - "in": { - "type": "string", - "enum": ["header", "query", "body", "cookie", "auto"] + "pskSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["psk"] + }, + "identity": { + "type": "string" + } + }, + "required": ["scheme"], + "additionalProperties": true }, - "name": { - "type": "string" + "oAuth2SecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "enum": ["oauth2"] + }, + "authorization": { + "$ref": "#/definitions/anyUri" + }, + "token": { + "$ref": "#/definitions/anyUri" + }, + "refresh": { + "$ref": "#/definitions/anyUri" + }, + "scopes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "flow": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": ["code", "client"] + } + ] + } + }, + "required": ["scheme"], + "additionalProperties": true + }, + "securityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/noSecurityScheme" + }, + { + "$ref": "#/definitions/autoSecurityScheme" + }, + { + "$ref": "#/definitions/comboSecurityScheme" + }, + { + "$ref": "#/definitions/basicSecurityScheme" + }, + { + "$ref": "#/definitions/digestSecurityScheme" + }, + { + "$ref": "#/definitions/apiKeySecurityScheme" + }, + { + "$ref": "#/definitions/bearerSecurityScheme" + }, + { + "$ref": "#/definitions/pskSecurityScheme" + }, + { + "$ref": "#/definitions/oAuth2SecurityScheme" + }, + { + "$ref": "#/definitions/additionalSecurityScheme" + } + ] } - }, - "required": ["scheme"], - "additionalProperties": true }, - "pskSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" }, - "description": { - "$ref": "#/definitions/description" + "title": { + "$ref": "#/definitions/title" }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "titles": { + "$ref": "#/definitions/titles" }, - "proxy": { - "$ref": "#/definitions/anyUri" + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/property_element" + } }, - "scheme": { - "type": "string", - "enum": ["psk"] + "actions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/action_element" + } }, - "identity": { - "type": "string" - } - }, - "required": ["scheme"], - "additionalProperties": true - }, - "oAuth2SecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" + "events": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/event_element" + } }, "description": { - "$ref": "#/definitions/description" + "$ref": "#/definitions/description" }, "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" + "$ref": "#/definitions/descriptions" }, - "scheme": { - "type": "string", - "enum": ["oauth2"] - }, - "authorization": { - "$ref": "#/definitions/anyUri" - }, - "token": { - "$ref": "#/definitions/anyUri" - }, - "refresh": { - "$ref": "#/definitions/anyUri" - }, - "scopes": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } + "version": { + "type": "object", + "properties": { + "instance": { + "type": "string" + } }, - { - "type": "string" + "required": ["instance"] + }, + "links": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/link_element" + }, + { + "$ref": "#/definitions/icon_link_element" + } + ] } - ] }, - "flow": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": ["code", "client", "device"] + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_root" } - ] - } - }, - "required": ["scheme"], - "additionalProperties": true - }, - "securityScheme": { - "oneOf": [ - { - "$ref": "#/definitions/noSecurityScheme" }, - { - "$ref": "#/definitions/autoSecurityScheme" - }, - { - "$ref": "#/definitions/comboSecurityScheme" + "base": { + "$ref": "#/definitions/anyUri" }, - { - "$ref": "#/definitions/basicSecurityScheme" + "securityDefinitions": { + "type": "object", + "minProperties": 1, + "additionalProperties": { + "$ref": "#/definitions/securityScheme" + } }, - { - "$ref": "#/definitions/digestSecurityScheme" + "schemaDefinitions": { + "type": "object", + "minProperties": 1, + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } }, - { - "$ref": "#/definitions/apiKeySecurityScheme" + "support": { + "$ref": "#/definitions/anyUri" }, - { - "$ref": "#/definitions/bearerSecurityScheme" + "created": { + "type": "string", + "format": "date-time" }, - { - "$ref": "#/definitions/pskSecurityScheme" + "modified": { + "type": "string", + "format": "date-time" + }, + "profile": { + "oneOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/anyUri" + } + } + ] }, - { - "$ref": "#/definitions/oAuth2SecurityScheme" + "security": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/additionalSecurityScheme" - } - ] - } - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uri" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/property_element" - } - }, - "actions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/action_element" - } - }, - "events": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/event_element" - } - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "version": { - "type": "object", - "properties": { - "instance": { - "type": "string" - } - }, - "required": ["instance"] - }, - "links": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/link_element" - }, - { - "$ref": "#/definitions/icon_link_element" - } - ] - } - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_root" - } - }, - "base": { - "$ref": "#/definitions/anyUri" - }, - "securityDefinitions": { - "type": "object", - "minProperties": 1, - "additionalProperties": { - "$ref": "#/definitions/securityScheme" - } - }, - "schemaDefinitions": { - "type": "object", - "minProperties": 1, - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "support": { - "$ref": "#/definitions/anyUri" - }, - "created": { - "type": "string", - "format": "date-time" - }, - "modified": { - "type": "string", - "format": "date-time" - }, - "profile": { - "oneOf": [ - { - "$ref": "#/definitions/anyUri" + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } }, - { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/anyUri" - } - } - ] - }, - "security": { - "oneOf": [ - { - "type": "string" + "@type": { + "$ref": "#/definitions/type_declaration" }, - { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } + "@context": { + "$ref": "#/definitions/thing-context" } - ] - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "@type": { - "$ref": "#/definitions/type_declaration" }, - "@context": { - "$ref": "#/definitions/thing-context" - } - }, - "required": ["title", "security", "securityDefinitions", "@context"], - "additionalProperties": true + "required": ["title", "security", "securityDefinitions", "@context"], + "additionalProperties": true } diff --git a/src/external/tm-schema.json b/src/external/tm-schema.json index 03adedeb..589f08b7 100644 --- a/src/external/tm-schema.json +++ b/src/external/tm-schema.json @@ -1,1966 +1,1960 @@ { - "title": "Thing Model", - "version": "1.1-05-September-2022", - "description": "JSON Schema for validating Thing Models. This is automatically generated from the WoT TD Schema.", - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/w3c/wot-thing-description/main/validation/tm-json-schema-validation.json", - "definitions": { - "anyUri": { - "type": "string" - }, - "description": { - "type": "string" - }, - "descriptions": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "title": { - "type": "string" - }, - "titles": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "security": { - "oneOf": [ - { - "type": "array", - "items": { + "title": "Thing Model", + "version": "1.1-12-March-2025", + "description": "JSON Schema for validating Thing Models. This is automatically generated from the WoT TD Schema.", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/w3c/wot-thing-description/main/validation/tm-json-schema-validation.json", + "definitions": { + "anyUri": { "type": "string" - } }, - { - "type": "string" - } - ] - }, - "scopes": { - "oneOf": [ - { - "type": "array", - "items": { + "description": { "type": "string" - } }, - { - "type": "string" - } - ] - }, - "subprotocol": { - "type": "string", - "examples": ["longpoll", "websub", "sse"] - }, - "thing-context-td-uri-v1": { - "type": "string", - "const": "https://www.w3.org/2019/wot/td/v1" - }, - "thing-context-td-uri-v1.1": { - "type": "string", - "const": "https://www.w3.org/2022/wot/td/v1.1" - }, - "thing-context-td-uri-temp": { - "type": "string", - "const": "http://www.w3.org/ns/td" - }, - "thing-context": { - "anyOf": [ - { - "$comment": "New context URI with other vocabularies after it but not the old one", - "type": "array", - "items": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - } - ], - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ], - "not": { - "$ref": "#/definitions/thing-context-td-uri-v1" - } - } - }, - { - "$comment": "Only the new context URI", - "$ref": "#/definitions/thing-context-td-uri-v1.1" - }, - { - "$comment": "Old context URI, followed by the new one and possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", - "type": "array", - "prefixItems": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1" + "descriptions": { + "type": "object", + "additionalProperties": { + "type": "string" }, - { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - } - ], - "minItems": 2, - "contains": { - "$ref": "#/definitions/thing-context-td-uri-v1.1" - }, - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ] - } - }, - { - "$comment": "Old context URI, followed by possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", - "type": "array", - "prefixItems": [ - { - "$ref": "#/definitions/thing-context-td-uri-v1" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ], - "minItems": 1, - "contains": { - "$ref": "#/definitions/thing-context-td-uri-v1" - }, - "additionalItems": { - "anyOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "object" - } - ] - } - }, - { - "$comment": "Only the new context URI", - "$ref": "#/definitions/thing-context-td-uri-v1" - } - ] - }, - "bcp47_string": { - "type": "string", - "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" - }, - "type_declaration": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "dataSchema-type": { - "type": "string", - "anyOf": [ - { - "enum": [ - "boolean", - "integer", - "number", - "string", - "object", - "array", - "null" - ] - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "dataSchema": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" }, "title": { - "$ref": "#/definitions/title" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" + "type": "string" }, "titles": { - "$ref": "#/definitions/titles" - }, - "writeOnly": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "readOnly": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - }, - "unit": { - "type": "string" - }, - "enum": { - "anyOf": [ - { - "type": "array", - "minItems": 1, - "uniqueItems": true + "type": "object", + "additionalProperties": { + "type": "string" }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "format": { - "type": "string" - }, - "const": {}, - "default": {}, - "contentEncoding": { - "type": "string" + "security": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] }, - "contentMediaType": { - "type": "string" + "scopes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] }, - "type": { - "$ref": "#/definitions/dataSchema-type" + "subprotocol": { + "type": "string", + "examples": ["longpoll", "websub", "sse"] }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/dataSchema" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - } - ] + "thing-context-td-uri-v1": { + "type": "string", + "const": "https://www.w3.org/2019/wot/td/v1" }, - "maxItems": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "thing-context-td-uri-v1.1": { + "type": "string", + "const": "https://www.w3.org/2022/wot/td/v1.1" }, - "minItems": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "thing-context-td-uri-temp": { + "type": "string", + "const": "http://www.w3.org/ns/td" }, - "minimum": { - "anyOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "thing-context": { + "anyOf": [ + { + "$comment": "New context URI with other vocabularies after it but not the old one", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1.1" + } + ], + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ], + "not": { + "$ref": "#/definitions/thing-context-td-uri-v1" + } + } + }, + { + "$comment": "Only the new context URI", + "$ref": "#/definitions/thing-context-td-uri-v1.1" + }, + { + "$comment": "Old context URI, followed by the new one and possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1" + }, + { + "$ref": "#/definitions/thing-context-td-uri-v1.1" + } + ], + "minItems": 2, + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ] + } + }, + { + "$comment": "Old context URI, followed by possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided", + "type": "array", + "items": [ + { + "$ref": "#/definitions/thing-context-td-uri-v1" + } + ], + "minItems": 1, + "additionalItems": { + "anyOf": [ + { + "$ref": "#/definitions/anyUri" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ] + } + }, + { + "$comment": "Only the old context URI", + "$ref": "#/definitions/thing-context-td-uri-v1" + } + ] }, - "maximum": { - "anyOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "bcp47_string": { + "type": "string", + "pattern": "^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" }, - "exclusiveMinimum": { - "type": "number" + "type_declaration": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "exclusiveMaximum": { - "type": "number" + "dataSchema-type": { + "type": "string", + "anyOf": [ + { + "enum": ["boolean", "integer", "number", "string", "object", "array", "null"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] }, - "minLength": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 + "dataSchema": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "title": { + "$ref": "#/definitions/title" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "writeOnly": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "readOnly": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + }, + "unit": { + "type": "string" + }, + "enum": { + "anyOf": [ + { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "format": { + "type": "string" + }, + "const": {}, + "default": {}, + "contentEncoding": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/dataSchema-type" + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/dataSchema" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + } + ] + }, + "maxItems": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minItems": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minimum": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "maximum": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "exclusiveMinimum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minLength": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "maxLength": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "multipleOf": { + "$ref": "#/definitions/multipleOfDefinition" + }, + "properties": { + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "required": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "maxLength": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 - }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalResponsesDefinition": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contentType": { + "type": "string" + }, + "schema": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } } - ] }, - "multipleOf": { - "$ref": "#/definitions/multipleOfDefinition" + "multipleOfDefinition": { + "anyOf": [ + { + "type": ["integer", "number"], + "exclusiveMinimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] }, - "properties": { - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "required": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } + "expectedResponse": { + "type": "object", + "properties": { + "contentType": { + "type": "string" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "additionalResponsesDefinition": { - "type": "array", - "items": { - "type": "object", - "properties": { - "contentType": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - } - }, - "multipleOfDefinition": { - "anyOf": [ - { - "type": ["integer", "number"], - "exclusiveMinimum": 0 - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "expectedResponse": { - "type": "object", - "properties": { - "contentType": { - "type": "string" - } - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "form_element_base": { - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string" + "form_element_base": { + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "href": { + "$ref": "#/definitions/anyUri" + }, + "contentType": { + "type": "string" + }, + "contentCoding": { + "type": "string" + }, + "subprotocol": { + "$ref": "#/definitions/subprotocol" + }, + "security": { + "$ref": "#/definitions/security" + }, + "scopes": { + "$ref": "#/definitions/scopes" + }, + "response": { + "$ref": "#/definitions/expectedResponse" + }, + "additionalResponses": { + "$ref": "#/definitions/additionalResponsesDefinition" + } }, - { - "type": "array", - "items": { - "type": "string" - } + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] - }, - "href": { - "$ref": "#/definitions/anyUri" - }, - "contentType": { - "type": "string" - }, - "contentCoding": { - "type": "string" - }, - "subprotocol": { - "$ref": "#/definitions/subprotocol" - }, - "security": { - "$ref": "#/definitions/security" }, - "scopes": { - "$ref": "#/definitions/scopes" - }, - "response": { - "$ref": "#/definitions/expectedResponse" - }, - "additionalResponses": { - "$ref": "#/definitions/additionalResponsesDefinition" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "form_element_property": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "anyOf": [ + "form_element_property": { + "allOf": [ { - "enum": [ - "readproperty", - "writeproperty", - "observeproperty", - "unobserveproperty" - ] + "$ref": "#/definitions/form_element_base" + } + ], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "anyOf": [ + { + "enum": ["readproperty", "writeproperty", "observeproperty", "unobserveproperty"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + { + "type": "array", + "items": { + "type": "string", + "anyOf": [ + { + "enum": [ + "readproperty", + "writeproperty", + "observeproperty", + "unobserveproperty" + ] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minItems": 1 + } + ] }, - { - "$ref": "#/definitions/placeholder-pattern" + "tm:ref": { + "$ref": "#/definitions/tm_ref" } - ] }, - { - "type": "array", - "items": { - "type": "string", - "anyOf": [ - { - "enum": [ - "readproperty", - "writeproperty", - "observeproperty", - "unobserveproperty" - ] - }, - { + "additionalProperties": true, + "propertyNames": { + "not": { "$ref": "#/definitions/placeholder-pattern" - } - ] - } + } } - ] }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "form_element_action": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "anyOf": [ + "form_element_action": { + "allOf": [ { - "enum": ["invokeaction", "queryaction", "cancelaction"] + "$ref": "#/definitions/form_element_base" + } + ], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "anyOf": [ + { + "enum": ["invokeaction", "queryaction", "cancelaction"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + { + "type": "array", + "items": { + "type": "string", + "anyOf": [ + { + "enum": ["invokeaction", "queryaction", "cancelaction"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minItems": 1 + } + ] }, - { - "$ref": "#/definitions/placeholder-pattern" + "tm:ref": { + "$ref": "#/definitions/tm_ref" } - ] }, - { - "type": "array", - "items": { - "type": "string", - "anyOf": [ - { - "enum": ["invokeaction", "queryaction", "cancelaction"] - }, - { + "additionalProperties": true, + "propertyNames": { + "not": { "$ref": "#/definitions/placeholder-pattern" - } - ] - } + } } - ] }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "form_element_event": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "anyOf": [ + "form_element_event": { + "allOf": [ { - "enum": ["subscribeevent", "unsubscribeevent"] + "$ref": "#/definitions/form_element_base" + } + ], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "anyOf": [ + { + "enum": ["subscribeevent", "unsubscribeevent"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + { + "type": "array", + "items": { + "type": "string", + "anyOf": [ + { + "enum": ["subscribeevent", "unsubscribeevent"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minItems": 1 + } + ] }, - { - "$ref": "#/definitions/placeholder-pattern" + "tm:ref": { + "$ref": "#/definitions/tm_ref" } - ] }, - { - "type": "array", - "items": { - "type": "string", - "anyOf": [ - { - "enum": ["subscribeevent", "unsubscribeevent"] - }, - { + "additionalProperties": true, + "propertyNames": { + "not": { "$ref": "#/definitions/placeholder-pattern" - } - ] - } + } } - ] }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "form_element_root": { - "allOf": [ - { - "$ref": "#/definitions/form_element_base" - } - ], - "type": "object", - "properties": { - "op": { - "oneOf": [ - { - "type": "string", - "anyOf": [ + "form_element_root": { + "allOf": [ { - "enum": [ - "readallproperties", - "writeallproperties", - "readmultipleproperties", - "writemultipleproperties", - "observeallproperties", - "unobserveallproperties", - "queryallactions", - "subscribeallevents", - "unsubscribeallevents" - ] + "$ref": "#/definitions/form_element_base" + } + ], + "type": "object", + "properties": { + "op": { + "oneOf": [ + { + "type": "string", + "anyOf": [ + { + "enum": [ + "readallproperties", + "writeallproperties", + "readmultipleproperties", + "writemultipleproperties", + "observeallproperties", + "unobserveallproperties", + "queryallactions", + "subscribeallevents", + "unsubscribeallevents" + ] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + { + "type": "array", + "items": { + "type": "string", + "anyOf": [ + { + "enum": [ + "readallproperties", + "writeallproperties", + "readmultipleproperties", + "writemultipleproperties", + "observeallproperties", + "unobserveallproperties", + "queryallactions", + "subscribeallevents", + "unsubscribeallevents" + ] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minItems": 1 + } + ] }, - { - "$ref": "#/definitions/placeholder-pattern" + "tm:ref": { + "$ref": "#/definitions/tm_ref" } - ] }, - { - "type": "array", - "items": { - "type": "string", - "anyOf": [ - { - "enum": [ - "readallproperties", - "writeallproperties", - "readmultipleproperties", - "writemultipleproperties", - "observeallproperties", - "unobserveallproperties", - "queryallactions", - "subscribeallevents", - "unsubscribeallevents" - ] - }, - { + "additionalProperties": true, + "propertyNames": { + "not": { "$ref": "#/definitions/placeholder-pattern" - } - ] - } - } - ] - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "form": { - "$comment": "This is NOT for validation purposes but for automatic generation of TS types. For more info, please see: https://github.com/w3c/wot-thing-description/pull/1319#issuecomment-994950057", - "oneOf": [ - { - "$ref": "#/definitions/form_element_property" - }, - { - "$ref": "#/definitions/form_element_action" - }, - { - "$ref": "#/definitions/form_element_event" - }, - { - "$ref": "#/definitions/form_element_root" - } - ] - }, - "property_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_property" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "observable": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "writeOnly": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "readOnly": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - }, - "unit": { - "type": "string" - }, - "enum": { - "anyOf": [ - { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - { - "$ref": "#/definitions/placeholder-pattern" + } } - ] - }, - "format": { - "type": "string" - }, - "const": {}, - "default": {}, - "type": { - "$ref": "#/definitions/dataSchema-type" }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/dataSchema" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/dataSchema" - } - } - ] + "form": { + "$comment": "This is NOT for validation purposes but for automatic generation of TS types. For more info, please see: https://github.com/w3c/wot-thing-description/pull/1319#issuecomment-994950057", + "oneOf": [ + { + "$ref": "#/definitions/form_element_property" + }, + { + "$ref": "#/definitions/form_element_action" + }, + { + "$ref": "#/definitions/form_element_event" + }, + { + "$ref": "#/definitions/form_element_root" + } + ] }, - "maxItems": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 + "property_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_property" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + }, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } + } + }, + "observable": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "writeOnly": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "readOnly": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + }, + "unit": { + "type": "string" + }, + "enum": { + "anyOf": [ + { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "format": { + "type": "string" + }, + "const": {}, + "default": {}, + "type": { + "$ref": "#/definitions/dataSchema-type" + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/dataSchema" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/dataSchema" + } + } + ] + }, + "maxItems": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minItems": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "minimum": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "maximum": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "exclusiveMinimum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minLength": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "maxLength": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "multipleOf": { + "$ref": "#/definitions/multipleOfDefinition" + }, + "properties": { + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + } + }, + "required": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "minItems": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 + "action_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_action" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + }, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } + } + }, + "input": { + "$ref": "#/definitions/dataSchema" + }, + "output": { + "$ref": "#/definitions/dataSchema" + }, + "safe": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "idempotent": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "synchronous": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "minimum": { - "anyOf": [ - { - "type": "number" + "event_element": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "title": { + "$ref": "#/definitions/title" + }, + "titles": { + "$ref": "#/definitions/titles" + }, + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_event" + } + }, + "uriVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/dataSchema" + }, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } + } + }, + "subscription": { + "$ref": "#/definitions/dataSchema" + }, + "data": { + "$ref": "#/definitions/dataSchema" + }, + "dataResponse": { + "$ref": "#/definitions/dataSchema" + }, + "cancellation": { + "$ref": "#/definitions/dataSchema" + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "maximum": { - "anyOf": [ - { - "type": "number" + "base_link_element": { + "type": "object", + "properties": { + "href": { + "$ref": "#/definitions/anyUri" + }, + "type": { + "type": "string" + }, + "rel": { + "type": "string" + }, + "anchor": { + "$ref": "#/definitions/anyUri" + }, + "hreflang": { + "anyOf": [ + { + "$ref": "#/definitions/bcp47_string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/bcp47_string" + } + } + ] + }, + "instanceName": { + "type": "string" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "exclusiveMinimum": { - "type": "number" + "link_element": { + "allOf": [ + { + "$ref": "#/definitions/base_link_element" + }, + { + "not": { + "description": "A basic link element should not contain sizes", + "type": "object", + "properties": { + "sizes": {} + }, + "required": ["sizes"] + } + }, + { + "not": { + "description": "A basic link element should not contain icon", + "properties": { + "rel": { + "anyOf": [ + { + "enum": ["icon"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + } + }, + "required": ["rel"] + } + } + ] }, - "exclusiveMaximum": { - "type": "number" + "icon_link_element": { + "allOf": [ + { + "$ref": "#/definitions/base_link_element" + }, + { + "properties": { + "rel": { + "const": "icon" + }, + "sizes": { + "type": "string", + "pattern": "[0-9]*x[0-9]+" + } + }, + "required": ["rel"] + } + ] }, - "minLength": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 + "additionalSecurityScheme": { + "description": "Applies to additional SecuritySchemes not defined in the WoT TD specification.", + "$comment": "Additional SecuritySchemes should always be defined via a context extension, using a prefixed value for the scheme. This prefix (e.g. 'ace', see the example below) must contain at least one character in order to reference a valid JSON-LD context extension.", + "examples": [ + { + "scheme": "ace:ACESecurityScheme", + "ace:as": "coaps://as.example.com/token", + "ace:audience": "coaps://rs.example.com", + "ace:scopes": ["limited", "special"], + "ace:cnonce": true + } + ], + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "pattern": ".+:.*" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "maxLength": { - "anyOf": [ - { - "type": "integer", - "minimum": 0 + "noSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["nosec"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "multipleOf": { - "$ref": "#/definitions/multipleOfDefinition" - }, - "properties": { - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - } - }, - "required": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } + "autoSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["auto"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + } }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "action_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_action" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - }, - "propertyNames": { "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "input": { - "$ref": "#/definitions/dataSchema" - }, - "output": { - "$ref": "#/definitions/dataSchema" - }, - "safe": { - "anyOf": [ - { - "type": "boolean" + "required": ["name"] }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "idempotent": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "comboSecurityScheme": { + "oneOf": [ + { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["combo"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "oneOf": { + "type": "array", + "minItems": 2, + "items": { + "type": "string" + } + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } + }, + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["combo"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "allOf": { + "type": "array", + "minItems": 2, + "items": { + "type": "string" + } + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } + }, + "additionalProperties": true + } + ] }, - "synchronous": { - "anyOf": [ - { - "type": "boolean" + "basicSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["basic"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "in": { + "type": "string", + "anyOf": [ + { + "enum": ["header", "query", "body", "cookie", "auto"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "name": { + "type": "string" + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "event_element": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_event" - } - }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - } - }, - "subscription": { - "$ref": "#/definitions/dataSchema" - }, - "data": { - "$ref": "#/definitions/dataSchema" - }, - "dataResponse": { - "$ref": "#/definitions/dataSchema" - }, - "cancellation": { - "$ref": "#/definitions/dataSchema" }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "base_link_element": { - "type": "object", - "properties": { - "href": { - "$ref": "#/definitions/anyUri" - }, - "type": { - "type": "string" - }, - "rel": { - "type": "string" - }, - "anchor": { - "$ref": "#/definitions/anyUri" - }, - "hreflang": { - "anyOf": [ - { - "$ref": "#/definitions/bcp47_string" + "digestSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["digest"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "qop": { + "type": "string", + "anyOf": [ + { + "enum": ["auth", "auth-int"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "in": { + "type": "string", + "anyOf": [ + { + "enum": ["header", "query", "body", "cookie", "auto"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "name": { + "type": "string" + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "type": "array", - "items": { - "$ref": "#/definitions/bcp47_string" - } + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "instanceName": { - "type": "string" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "link_element": { - "allOf": [ - { - "$ref": "#/definitions/base_link_element" - }, - { - "not": { - "description": "A basic link element should not contain sizes", + "apiKeySecurityScheme": { "type": "object", "properties": { - "sizes": {} + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["apikey"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "in": { + "type": "string", + "anyOf": [ + { + "enum": ["header", "query", "body", "cookie", "uri", "auto"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "name": { + "type": "string" + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - "required": ["sizes"] - } - }, - { - "not": { - "description": "A basic link element should not contain icon", - "properties": { - "rel": { - "anyOf": [ - { - "enum": ["icon"] - }, - { + "additionalProperties": true, + "propertyNames": { + "not": { "$ref": "#/definitions/placeholder-pattern" - } - ] - } - }, - "required": ["rel"] - } - } - ] - }, - "icon_link_element": { - "allOf": [ - { - "$ref": "#/definitions/base_link_element" - }, - { - "properties": { - "rel": { - "const": "icon" - }, - "sizes": { - "type": "string", - "pattern": "[0-9]*x[0-9]+" + } } - }, - "required": ["rel"] - } - ] - }, - "additionalSecurityScheme": { - "description": "Applies to additional SecuritySchemes not defined in the WoT TD specification.", - "$comment": "Additional SecuritySchemes should always be defined via a context extension, using a prefixed value for the scheme. This prefix (e.g. 'ace', see the example below) must contain at least one character in order to reference a valid JSON-LD context extension.", - "examples": [ - { - "scheme": "ace:ACESecurityScheme", - "ace:as": "coaps://as.example.com/token", - "ace:audience": "coaps://rs.example.com", - "ace:scopes": ["limited", "special"], - "ace:cnonce": true - } - ], - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "pattern": ".+:.*" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "noSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["nosec"] + "bearerSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["bearer"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "authorization": { + "$ref": "#/definitions/anyUri" + }, + "alg": { + "type": "string" + }, + "format": { + "type": "string" + }, + "in": { + "type": "string", + "anyOf": [ + { + "enum": ["header", "query", "body", "cookie", "auto"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "name": { + "type": "string" + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "autoSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["auto"] + "pskSecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" + }, + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["psk"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "identity": { + "type": "string" + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" + } }, - { - "$ref": "#/definitions/placeholder-pattern" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] - } - }, - "not": { - "required": ["name"] - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "comboSecurityScheme": { - "oneOf": [ - { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["combo"] + }, + "oAuth2SecurityScheme": { + "type": "object", + "properties": { + "@type": { + "$ref": "#/definitions/type_declaration" }, - { - "$ref": "#/definitions/placeholder-pattern" + "description": { + "$ref": "#/definitions/description" + }, + "descriptions": { + "$ref": "#/definitions/descriptions" + }, + "proxy": { + "$ref": "#/definitions/anyUri" + }, + "scheme": { + "type": "string", + "anyOf": [ + { + "enum": ["oauth2"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + }, + "authorization": { + "$ref": "#/definitions/anyUri" + }, + "token": { + "$ref": "#/definitions/anyUri" + }, + "refresh": { + "$ref": "#/definitions/anyUri" + }, + "scopes": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "flow": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "anyOf": [ + { + "enum": ["code", "client"] + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] + } + ] + }, + "tm:ref": { + "$ref": "#/definitions/tm_ref" } - ] }, - "oneOf": { - "type": "array", - "minItems": 2, - "items": { - "type": "string" - } - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" + "additionalProperties": true, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - }, - "additionalProperties": true - }, - { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "anyOf": [ + }, + "securityScheme": { + "anyOf": [ + { + "$ref": "#/definitions/noSecurityScheme" + }, + { + "$ref": "#/definitions/autoSecurityScheme" + }, + { + "$ref": "#/definitions/comboSecurityScheme" + }, + { + "$ref": "#/definitions/basicSecurityScheme" + }, + { + "$ref": "#/definitions/digestSecurityScheme" + }, { - "enum": ["combo"] + "$ref": "#/definitions/apiKeySecurityScheme" }, { - "$ref": "#/definitions/placeholder-pattern" + "$ref": "#/definitions/bearerSecurityScheme" + }, + { + "$ref": "#/definitions/pskSecurityScheme" + }, + { + "$ref": "#/definitions/oAuth2SecurityScheme" + }, + { + "$ref": "#/definitions/additionalSecurityScheme" } - ] - }, - "allOf": { - "type": "array", - "minItems": 2, - "items": { - "type": "string" - } - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true - } - ] - }, - "basicSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" + ] }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["basic"] - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "tm_type_declaration": { + "oneOf": [ + { + "type": "string", + "const": "tm:ThingModel" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "contains": { + "const": "tm:ThingModel" + } + } + ] }, - "in": { - "type": "string", - "anyOf": [ - { - "enum": ["header", "query", "body", "cookie", "auto"] - }, - { - "$ref": "#/definitions/placeholder-pattern" + "placeholder-pattern": { + "type": "string", + "pattern": "^.*[{]{2}[ -~]+[}]{2}.*$" + }, + "tm_optional": { + "type": "array", + "items": { + "$comment": "this first checks for the general structure of /properties/myProp and then prohibits using / 3 times", + "allOf": [ + { + "type": "string", + "pattern": "^((/properties/)|(/actions/)|(/events/))(([^/]))", + "$comment": "regex tests available at https://regex101.com/r/UgOzrJ/1" + }, + { + "not": { + "type": "string", + "pattern": "(/)(.*/){2}", + "$comment": "regex tests available at https://regex101.com/r/r7vB0r/2" + } + } + ] } - ] - }, - "name": { - "type": "string" }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" + "tm_ref": { + "type": "string", + "format": "uri-reference" } - } }, - "digestSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" + "type": "object", + "properties": { + "id": { + "type": "string" }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["digest"] - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "title": { + "$ref": "#/definitions/title" }, - "qop": { - "type": "string", - "anyOf": [ - { - "enum": ["auth", "auth-int"] - }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] + "titles": { + "$ref": "#/definitions/titles" }, - "in": { - "type": "string", - "anyOf": [ - { - "enum": ["header", "query", "body", "cookie", "auto"] + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/property_element" }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] - }, - "name": { - "type": "string" - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "apiKeySecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["apikey"] + "actions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/action_element" }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] }, - "in": { - "type": "string", - "anyOf": [ - { - "enum": ["header", "query", "body", "cookie", "uri", "auto"] + "events": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/event_element" }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] - }, - "name": { - "type": "string" - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "bearerSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" }, "description": { - "$ref": "#/definitions/description" + "$ref": "#/definitions/description" }, "descriptions": { - "$ref": "#/definitions/descriptions" + "$ref": "#/definitions/descriptions" }, - "proxy": { - "$ref": "#/definitions/anyUri" + "version": { + "anyOf": [ + { + "type": "object", + "properties": { + "model": { + "type": "string" + } + }, + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } + }, + "not": { + "type": "object", + "properties": { + "instance": { + "type": "string" + } + }, + "required": ["instance"] + } + }, + { + "$ref": "#/definitions/placeholder-pattern" + } + ] }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["bearer"] - }, - { - "$ref": "#/definitions/placeholder-pattern" + "links": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/link_element" + }, + { + "$ref": "#/definitions/icon_link_element" + } + ] } - ] - }, - "authorization": { - "$ref": "#/definitions/anyUri" - }, - "alg": { - "type": "string" - }, - "format": { - "type": "string" }, - "in": { - "type": "string", - "anyOf": [ - { - "enum": ["header", "query", "body", "cookie", "auto"] - }, - { - "$ref": "#/definitions/placeholder-pattern" + "forms": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_element_root" } - ] - }, - "name": { - "type": "string" - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "pskSecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" }, - "proxy": { - "$ref": "#/definitions/anyUri" + "base": { + "$ref": "#/definitions/anyUri" }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["psk"] + "securityDefinitions": { + "type": "object", + "minProperties": 1, + "additionalProperties": { + "$ref": "#/definitions/securityScheme" }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] - }, - "identity": { - "type": "string" - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "oAuth2SecurityScheme": { - "type": "object", - "properties": { - "@type": { - "$ref": "#/definitions/type_declaration" }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "proxy": { - "$ref": "#/definitions/anyUri" - }, - "scheme": { - "type": "string", - "anyOf": [ - { - "enum": ["oauth2"] + "schemaDefinitions": { + "type": "object", + "minProperties": 1, + "additionalProperties": { + "$ref": "#/definitions/dataSchema" }, - { - "$ref": "#/definitions/placeholder-pattern" + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } } - ] - }, - "authorization": { - "$ref": "#/definitions/anyUri" }, - "token": { - "$ref": "#/definitions/anyUri" + "support": { + "$ref": "#/definitions/anyUri" }, - "refresh": { - "$ref": "#/definitions/anyUri" + "created": { + "type": "string" }, - "scopes": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] + "modified": { + "type": "string" }, - "flow": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "anyOf": [ + "profile": { + "oneOf": [ { - "enum": ["code", "client", "device"] + "$ref": "#/definitions/anyUri" }, { - "$ref": "#/definitions/placeholder-pattern" + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/anyUri" + } } - ] - } - ] - }, - "tm:ref": { - "$ref": "#/definitions/tm_ref" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "securityScheme": { - "anyOf": [ - { - "$ref": "#/definitions/noSecurityScheme" - }, - { - "$ref": "#/definitions/autoSecurityScheme" - }, - { - "$ref": "#/definitions/comboSecurityScheme" - }, - { - "$ref": "#/definitions/basicSecurityScheme" - }, - { - "$ref": "#/definitions/digestSecurityScheme" - }, - { - "$ref": "#/definitions/apiKeySecurityScheme" - }, - { - "$ref": "#/definitions/bearerSecurityScheme" - }, - { - "$ref": "#/definitions/pskSecurityScheme" + ] }, - { - "$ref": "#/definitions/oAuth2SecurityScheme" + "security": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/additionalSecurityScheme" - } - ] - }, - "tm_type_declaration": { - "oneOf": [ - { - "type": "string", - "const": "tm:ThingModel" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "contains": { - "const": "tm:ThingModel" - } - } - ] - }, - "placeholder-pattern": { - "type": "string", - "pattern": "^.*[{]{2}[ -~]+[}]{2}.*$" - }, - "tm_optional": { - "type": "array", - "items": { - "$comment": "this first checks for the general structure of /properties/myProp and then prohibits using / 3 times", - "allOf": [ - { - "type": "string", - "pattern": "^((/properties/)|(/actions/)|(/events/))(([^/]))", - "$comment": "regex tests available at https://regex101.com/r/UgOzrJ/1" - }, - { - "not": { - "type": "string", - "pattern": "(/)(.*\\1){2}", - "$comment": "regex tests available at https://regex101.com/r/Ytzd72/1" - } - } - ] - } - }, - "tm_ref": { - "type": "string", - "format": "uri-reference" - } - }, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "title": { - "$ref": "#/definitions/title" - }, - "titles": { - "$ref": "#/definitions/titles" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/property_element" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "actions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/action_element" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "events": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/event_element" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "description": { - "$ref": "#/definitions/description" - }, - "descriptions": { - "$ref": "#/definitions/descriptions" - }, - "version": { - "anyOf": [ - { - "type": "object", - "properties": { - "model": { - "type": "string" - } - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - }, - "not": { + "uriVariables": { "type": "object", - "properties": { - "instance": { - "type": "string" - } + "additionalProperties": { + "$ref": "#/definitions/dataSchema" }, - "required": ["instance"] - } + "propertyNames": { + "not": { + "$ref": "#/definitions/placeholder-pattern" + } + } }, - { - "$ref": "#/definitions/placeholder-pattern" - } - ] - }, - "links": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/link_element" - }, - { - "$ref": "#/definitions/icon_link_element" - } - ] - } - }, - "forms": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_element_root" - } - }, - "base": { - "$ref": "#/definitions/anyUri" - }, - "securityDefinitions": { - "type": "object", - "minProperties": 1, - "additionalProperties": { - "$ref": "#/definitions/securityScheme" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "schemaDefinitions": { - "type": "object", - "minProperties": 1, - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - }, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - } - }, - "support": { - "$ref": "#/definitions/anyUri" - }, - "created": { - "type": "string" - }, - "modified": { - "type": "string" - }, - "profile": { - "oneOf": [ - { - "$ref": "#/definitions/anyUri" - }, - { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/anyUri" - } - } - ] - }, - "security": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } + "@type": { + "$ref": "#/definitions/tm_type_declaration" + }, + "@context": { + "$ref": "#/definitions/thing-context" + }, + "tm:optional": { + "$ref": "#/definitions/tm_optional" } - ] }, - "uriVariables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/dataSchema" - }, - "propertyNames": { + "additionalProperties": true, + "propertyNames": { "not": { - "$ref": "#/definitions/placeholder-pattern" + "$ref": "#/definitions/placeholder-pattern" } - } - }, - "@type": { - "$ref": "#/definitions/tm_type_declaration" - }, - "@context": { - "$ref": "#/definitions/thing-context" }, - "tm:optional": { - "$ref": "#/definitions/tm_optional" - } - }, - "additionalProperties": true, - "propertyNames": { - "not": { - "$ref": "#/definitions/placeholder-pattern" - } - }, - "required": ["@context", "@type"] + "required": ["@context", "@type"] } diff --git a/src/workers/schemaWorker.js b/src/workers/schemaWorker.js index cb77252c..9c4588d0 100644 --- a/src/workers/schemaWorker.js +++ b/src/workers/schemaWorker.js @@ -23,9 +23,9 @@ import { isThingModel } from "../utils/tdOperations"; let lastSentSchemaMap = new Map(); const tdSchema = - "https://raw.githubusercontent.com/thingweb/thingweb-playground/%40thing-description-playground/web%401.0.0/packages/playground-core/td-schema.json"; + "https://raw.githubusercontent.com/w3c/wot-resources/refs/heads/main/td/v1.1/validation/td-json-schema-validation.json"; const tmSchema = - "https://raw.githubusercontent.com/w3c/wot-thing-description/main/validation/tm-json-schema-validation.json"; + "https://raw.githubusercontent.com/w3c/wot-resources/refs/heads/main/td/v1.1/validation/tm-json-schema-validation.json"; self.onmessage = async (message) => { // Check that prevents messages sent from webpack and react scripts to be executed.