From 75ac4f867a5521b336fde9f600c88c28791fc704 Mon Sep 17 00:00:00 2001 From: Maya Nigrosh Date: Fri, 23 Aug 2019 11:37:29 -0400 Subject: [PATCH 01/13] New schema discussed by members of the E1.37-5 task group. - Modified spacing for ease in readability - Added schema "title" (which may need to have the word "informative" removed) - Added description values - Changed single-value enums to "const" - Separated "bits" from "bitField" - Created a simpleType enum for all basic types - Alphabetized definitions - Changed "label" to "labeledInteger" * changed the "label" property to "name", for consistency - Changed "max_size" and "min_size" to "maxLength" and "minLength", for consistency with JSON schema naming conventions. * Added '"uniqueItems": true' to the "bits" field of the "bitField" field type, the integer field type, the command type, and the range type * Created the subdeviceType with an enumeration of the possible values. * Added a "pdEnvelope" type to help deal with the proposed PACKED_PIDS parameter message * Added a new "list" type that represents a list of any valid non-list field type. * Removed the requirement of having "name" for some of the types so they can also be used in lists. * Suffixed all the types with "Type" so that naming is consistent. These aren't the words that will be used when writing a schema and they don't have to be the same as the constant names, eg. "uint8" or "string" or "list". * Added a "compoundType" type so that we don't have to make a special type for all possibilities. For example, the list of 3-field items returned in SLOT_INFO. These compound types are only supported in the list type, "listType", because a field is only used in "commandType". * Factored all the types into a "oneOf" so that it can be referenced from "compoundType", "listType", and "fieldType". * Changed "boundedIntegerType" to "integerType" and "boundedStringType" to "stringType". * Removed "name" from the "required" list of "labeledIntegerType" and "listType". * Changed "upper" and "lower" in "rangeType" to "maximum" and "minimum", respectively, for consistency with JSON schema naming conventions. * Added an optional "length" property to "pdEnvelope". * Removed "fieldType" and instead made "commandType" be a collection of "oneOfType". --- schema.json | 401 ++++++++++++++++++++++++++-------------------------- 1 file changed, 199 insertions(+), 202 deletions(-) diff --git a/schema.json b/schema.json index ecc5cd3..8a04c99 100644 --- a/schema.json +++ b/schema.json @@ -1,255 +1,252 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Parameter Metadata Language Schema, Informative", + "description": "The (informative) schema for the Parameter Metadata Language from Section 5 of E1.37-5. This schema is subject to change.", "definitions": { - "bitfield": { + "bitType": { + "description": "Describes the meaning of one bit in a bit field.", "type": "object", "properties": { + "name": { "$ref": "#/definitions/nameType" }, "index": { "type": "integer", "minimum": 0 - }, - "name": { - "$ref": "#/definitions/name" } }, - "required": ["index", "name"] + "required": [ "name", "index" ] + }, + "bitFieldType": { + "description": "A bit field, a collection of 'bit' items.", + "properties": { + "name": { "$ref": "#/definitions/nameType" }, + "type": { "const": "bitField" }, + "bits": { + "type": "array", + "items": { "$ref": "#/definitions/bitType" }, + "uniqueItems": true + }, + "size": { + "type": "integer", + "multipleOf": 8 + } + }, + "required": [ "type", "bits" ] + }, + "commandType": { + "description": "Represents an RDM command, a collection of 'field' items, each a simple or compound type.", + "type": "array", + "items": { "$ref": "#/definitions/oneOfTypes" }, + "uniqueItems": true }, - "command": { + "compoundType": { + "description": "Defines a compound type, a type used to combine other types. This is useful for including in lists.", "type": "object", "properties": { - "fields": { + "name": { "$ref": "#/definitions/nameType" }, + "type": { "const": "compound" }, + "subtypes": { "type": "array", "items": { - "$ref": "#/definitions/field" + "$ref": "#/definitions/oneOfTypes" } } }, - "required": ["fields"] + "required": [ "type", "subtypes" ] }, - "field": { - "type": "object", - "oneOf": [ - { - "properties": { - "type": { - "enum": ["bitfield"] - }, - "bits": { - "type": "array", - "items": { - "$ref": "#/definitions/bitfield" - } - }, - "size": { - "type": "integer", - "multipleOf": 8 - } - }, - "required": ["bits", "type", "size"] - }, - { - "properties": { - "type": { - "enum": ["bool"] - }, - "name": { - "$ref": "#/definitions/name" - } - }, - "required": ["name", "type"] - }, - { - "properties": { - "type": { - "enum": ["int8", "int16", "int32", "int64", - "uint8", "uint16", "uint32", "uint64"] - }, - "name": { - "$ref": "#/definitions/name" - }, - "labels": { - "type": "array", - "items": { - "$ref": "#/definitions/label" - } - }, - "prefix": { - "type": "integer", - "maximum": 255, - "minimum": 0 - }, - "ranges": { - "type": "array", - "items": { - "$ref": "#/definitions/range" - } - }, - "unit": { - "type": "integer", - "maximum": 255, - "minimum": 0 - } - }, - "required": ["name", "type"] - }, - { - "properties": { - "type": { - "enum": ["string"] - }, - "name": { - "$ref": "#/definitions/name" - }, - "max_size": { - "type": "integer", - "minimum": 0, - "exclusiveMinimum": true - }, - "min_size": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["name", "type"] + "integerType": { + "description": "A signed or unsigned integer, can have an optional prefix, unit, and range.", + "properties": { + "name": { "$ref": "#/definitions/nameType" }, + "type": { + "enum": [ + "int8", + "int16", + "int32", + "int64", + "uint8", + "uint16", + "uint32", + "uint64" + ] }, - { - "properties": { - "type": { - "enum": ["ipv4"] - }, - "name": { - "$ref": "#/definitions/name" - } - }, - "required": ["name", "type"] + "labels": { + "description": "A list of labels that name special values.", + "type": "array", + "items": { "$ref": "#/definitions/labeledIntegerType" }, + "uniqueItems": true }, - { - "properties": { - "type": { - "enum": ["mac"] - }, - "name": { - "$ref": "#/definitions/name" - } - }, - "required": ["name", "type"] + "prefix": { + "description": "The unit prefix, defined in Table A-14 of E1.20.", + "type": "integer", + "minimum": 0, + "maximum": 255 }, - { - "properties": { - "type": { - "enum": ["uid"] - }, - "name": { - "$ref": "#/definitions/name" - } - }, - "required": ["name", "type"] + "ranges": { + "description": "A list of possible ranges for the value. The complete range is the union of all the ranges and labels.", + "type": "array", + "items": { "$ref": "#/definitions/rangeType" }, + "uniqueItems": true }, - { - "properties": { - "type": { - "enum": ["group"] - }, - "name": { - "$ref": "#/definitions/name" - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/definitions/field" - } - }, - "max_size": { - "type": "integer", - "minimum": 0, - "exclusiveMinimum": true - }, - "min_size": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["name", "fields", "type"] + "unit": { + "description": "The unit type, defined in Table A-13 of E1.20.", + "type": "integer", + "minimum": 0, + "maximum": 255 } - ] + }, + "required": [ "type" ] + }, + "labeledIntegerType": { + "description": "Associates a name to an integer value.", + "type": "object", + "properties": { + "name": { "$ref": "#/definitions/nameType" }, + "value": { "type": "integer" } + }, + "required": [ "value" ] }, - "label": { + "listType": { + "description": "A list of objects all having the same type.", "type": "object", "properties": { - "label": { - "minLength": 1, - "type": "string" + "name": { "$ref": "#/definitions/nameType" }, + "type": { "const": "list" }, + "itemType": { + "$ref": "#/definitions/oneOfTypes" }, - "value": { + "minItems": { + "description": "The minimum list size.", + "type": "integer", + "minimum": 0 + }, + "maxItems": { + "description": "The maximum list size.", "type": "integer", - "maximum": 4294967295, "minimum": 0 } }, - "required": ["label", "value"] + "required": [ "type", "itemType" ] }, - "name": { + "nameType": { + "description": "A name is a string having a length of at least 1.", "type": "string", "minLength": 1 }, - "range": { + "oneOfTypes": { + "description": "One of any of the types. This provides a single location to keep the list.", + "oneOf": [ + { "$ref": "#/definitions/bitFieldType" }, + { "$ref": "#/definitions/compoundType" }, + { "$ref": "#/definitions/integerType" }, + { "$ref": "#/definitions/listType" }, + { "$ref": "#/definitions/pdEnvelopeType" }, + { "$ref": "#/definitions/simpleType" }, + { "$ref": "#/definitions/stringType" }, + { "$ref": "#/definitions/subdeviceType" } + ] + }, + "subdeviceType": { + "description": "A subdevice type. One of the root device (e.g. value 0), the root or all subdevices or the broadcast subdevice, the root or any subdevice, or just any subdevice.", + "type" : "string", + "enum": [ + "root", + "root_or_any_subdevice_or_broadcast", + "root_or_any_subdevice", + "any_subdevice" + ] + }, + "pdEnvelopeType": { + "description": "Contains a length/data pair for one Parameter Data item, where the length is an unsigned 8-bit value and the data has 'length' bytes. This exists to provide a schema definition for the 'envelope' of a PDL/PD pair.", + "type": "object", + "properties": { + "type": { "const": "pdEnvelope" }, + "length": { + "description": "The data length can be optionally specified.", + "type": "integer", + "minimum": 0 + } + }, + "required": [ "type" ] + }, + "rangeType": { + "description": "Defines an inclusive range of numbers.", "type": "object", "properties": { - "lower": { + "minimum": { + "description": "The lower bound, inclusive.", "type": "integer" }, - "upper": { + "maximum": { + "description": "The upper bound, inclusive.", "type": "integer" } }, - "required": ["lower", "upper"] + "required": [ "minimum", "maximum" ] + }, + "simpleType": { + "description": "Simple type that has no fields other than a name and type.", + "type": "object", + "properties": { + "name": { "$ref": "#/definitions/nameType" }, + "type": { + "enum": [ + "bool", + "hostname", + "ipv4", + "ipv6", + "uid", + "url" + ] + } + }, + "required": [ "type" ] + }, + "stringType": { + "description": "A string having a possibly bounded size.", + "properties": { + "name": { "$ref": "#/definitions/nameType" }, + "type": { "const": "string" }, + "minLength": { + "description": "The minimum string length.", + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "description": "The maximum string length.", + "type": "integer", + "minimum": 0 + } + }, + "required": [ "type" ] } }, "type": "object", "properties": { - "get_request": { - "$ref": "#/definitions/command" - }, - "get_response": { - "$ref": "#/definitions/command" - }, - "get_subdevice_range": { - "maximum": 3, - "minimum": 0, - "type": "integer" - }, - "name": { - "minLength": 1, - "type": "string" - }, + "name": { "$ref": "#/definitions/nameType" }, "pid": { - "maximum": 65535, - "minimum": 0, - "type": "integer" - }, - "set_request": { - "$ref": "#/definitions/command" - }, - "set_response": { - "$ref": "#/definitions/command" - }, - "set_subdevice_range": { - "maximum": 3, + "type": "integer", "minimum": 0, - "type": "integer" + "maximum": 65535 }, "version": { - "minimum": 0, - "type": "integer" - } + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "get_request": { "$ref": "#/definitions/commandType" }, + "get_response": { "$ref": "#/definitions/commandType" }, + "get_subdevice_range" : { "$ref": "#/definitions/subdeviceType" }, + "set_request": { "$ref": "#/definitions/commandType" }, + "set_response": { "$ref": "#/definitions/commandType" }, + "set_subdevice_range" : { "$ref": "#/definitions/subdeviceType" } }, - "required": ["name", "pid", "version"], + "required": [ "name", "pid", "version" ], "dependencies": { - "get_request": ["get_response", "get_subdevice_range"], - "get_response": ["get_request", "get_subdevice_range"], - "get_subdevice_range": ["get_request", "get_response"], - "set_request": ["set_response", "set_subdevice_range"], - "set_response": ["set_request", "set_subdevice_range"], - "set_subdevice_range": ["set_request", "set_response"] + "get_request": [ "get_response" ], + "get_response": [ "get_request" ], + "get_subdevice_range" : [ "get_request", "get_response" ], + "set_request": [ "set_response" ], + "set_response": [ "set_request" ], + "set_subdevice_range" : [ "set_request", "set_response" ] } -} +} \ No newline at end of file From 1ec157bc42ee9a8cf32efd5a522f04d618835c15 Mon Sep 17 00:00:00 2001 From: Maya Nigrosh Date: Fri, 23 Aug 2019 13:29:27 -0400 Subject: [PATCH 02/13] Fixed the line-wrapping issues that caused the failed CI build and failed pull request. Added the MAC type, which had been forgotten until going over the public review comments. --- schema.json | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/schema.json b/schema.json index 8a04c99..36c44e3 100644 --- a/schema.json +++ b/schema.json @@ -1,7 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Parameter Metadata Language Schema, Informative", - "description": "The (informative) schema for the Parameter Metadata Language from Section 5 of E1.37-5. This schema is subject to change.", + "description": "The (informative) schema for the Parameter Metadata Language + from E1.37-5, Section 5. This schema is subject to change.", "definitions": { "bitType": { "description": "Describes the meaning of one bit in a bit field.", @@ -33,13 +34,15 @@ "required": [ "type", "bits" ] }, "commandType": { - "description": "Represents an RDM command, a collection of 'field' items, each a simple or compound type.", + "description": "Represents an RDM command, a collection of 'field' items, + each a simple or compound type.", "type": "array", "items": { "$ref": "#/definitions/oneOfTypes" }, "uniqueItems": true }, "compoundType": { - "description": "Defines a compound type, a type used to combine other types. This is useful for including in lists.", + "description": "Defines a compound type, a type used to combine other + types. This is useful for including in lists.", "type": "object", "properties": { "name": { "$ref": "#/definitions/nameType" }, @@ -54,7 +57,8 @@ "required": [ "type", "subtypes" ] }, "integerType": { - "description": "A signed or unsigned integer, can have an optional prefix, unit, and range.", + "description": "A signed or unsigned integer, can have an optional + prefix, unit, and range.", "properties": { "name": { "$ref": "#/definitions/nameType" }, "type": { @@ -82,7 +86,9 @@ "maximum": 255 }, "ranges": { - "description": "A list of possible ranges for the value. The complete range is the union of all the ranges and labels.", + "description": "A list of possible ranges for the value. The + complete range is the union of all the ranges and + labels.", "type": "array", "items": { "$ref": "#/definitions/rangeType" }, "uniqueItems": true @@ -133,7 +139,8 @@ "minLength": 1 }, "oneOfTypes": { - "description": "One of any of the types. This provides a single location to keep the list.", + "description": "One of any of the types. This provides a single location + to keep the list.", "oneOf": [ { "$ref": "#/definitions/bitFieldType" }, { "$ref": "#/definitions/compoundType" }, @@ -146,7 +153,9 @@ ] }, "subdeviceType": { - "description": "A subdevice type. One of the root device (e.g. value 0), the root or all subdevices or the broadcast subdevice, the root or any subdevice, or just any subdevice.", + "description": "A subdevice type. One of the root device (e.g. value 0), + the root or all subdevices or the broadcast subdevice, + the root or any subdevice, or just any subdevice.", "type" : "string", "enum": [ "root", @@ -156,7 +165,10 @@ ] }, "pdEnvelopeType": { - "description": "Contains a length/data pair for one Parameter Data item, where the length is an unsigned 8-bit value and the data has 'length' bytes. This exists to provide a schema definition for the 'envelope' of a PDL/PD pair.", + "description": "Contains a length/data pair for one Parameter Data item, + where the length is an unsigned 8-bit value and the data + has 'length' bytes. This exists to provide a schema + definition for the 'envelope' of a PDL/PD pair.", "type": "object", "properties": { "type": { "const": "pdEnvelope" }, @@ -184,7 +196,8 @@ "required": [ "minimum", "maximum" ] }, "simpleType": { - "description": "Simple type that has no fields other than a name and type.", + "description": "Simple type that has no fields other than a name and + type.", "type": "object", "properties": { "name": { "$ref": "#/definitions/nameType" }, @@ -194,6 +207,7 @@ "hostname", "ipv4", "ipv6", + "mac", "uid", "url" ] From 132c5adf3e59b8718dce77f7965d18ff72deef35 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 11:05:17 +0100 Subject: [PATCH 03/13] Fix the line wrapping of JSON text strings --- schema.json | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/schema.json b/schema.json index 36c44e3..fc8b436 100644 --- a/schema.json +++ b/schema.json @@ -1,8 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Parameter Metadata Language Schema, Informative", - "description": "The (informative) schema for the Parameter Metadata Language - from E1.37-5, Section 5. This schema is subject to change.", + "description": "The (informative) schema for the Parameter Metadata Language from E1.37-5, Section 5. This schema is subject to change.", "definitions": { "bitType": { "description": "Describes the meaning of one bit in a bit field.", @@ -34,15 +33,13 @@ "required": [ "type", "bits" ] }, "commandType": { - "description": "Represents an RDM command, a collection of 'field' items, - each a simple or compound type.", + "description": "Represents an RDM command, a collection of 'field' items, each a simple or compound type.", "type": "array", "items": { "$ref": "#/definitions/oneOfTypes" }, "uniqueItems": true }, "compoundType": { - "description": "Defines a compound type, a type used to combine other - types. This is useful for including in lists.", + "description": "Defines a compound type, a type used to combine other types. This is useful for including in lists.", "type": "object", "properties": { "name": { "$ref": "#/definitions/nameType" }, @@ -57,8 +54,7 @@ "required": [ "type", "subtypes" ] }, "integerType": { - "description": "A signed or unsigned integer, can have an optional - prefix, unit, and range.", + "description": "A signed or unsigned integer, can have an optional prefix, unit, and range.", "properties": { "name": { "$ref": "#/definitions/nameType" }, "type": { @@ -86,9 +82,7 @@ "maximum": 255 }, "ranges": { - "description": "A list of possible ranges for the value. The - complete range is the union of all the ranges and - labels.", + "description": "A list of possible ranges for the value. The complete range is the union of all the ranges and labels.", "type": "array", "items": { "$ref": "#/definitions/rangeType" }, "uniqueItems": true @@ -139,8 +133,7 @@ "minLength": 1 }, "oneOfTypes": { - "description": "One of any of the types. This provides a single location - to keep the list.", + "description": "One of any of the types. This provides a single location to keep the list.", "oneOf": [ { "$ref": "#/definitions/bitFieldType" }, { "$ref": "#/definitions/compoundType" }, @@ -153,9 +146,7 @@ ] }, "subdeviceType": { - "description": "A subdevice type. One of the root device (e.g. value 0), - the root or all subdevices or the broadcast subdevice, - the root or any subdevice, or just any subdevice.", + "description": "A subdevice type. One of the root device (e.g. value 0), the root or all subdevices or the broadcast subdevice, the root or any subdevice, or just any subdevice.", "type" : "string", "enum": [ "root", @@ -165,10 +156,7 @@ ] }, "pdEnvelopeType": { - "description": "Contains a length/data pair for one Parameter Data item, - where the length is an unsigned 8-bit value and the data - has 'length' bytes. This exists to provide a schema - definition for the 'envelope' of a PDL/PD pair.", + "description": "Contains a length/data pair for one Parameter Data item, where the length is an unsigned 8-bit value and the data has 'length' bytes. This exists to provide a schema definition for the 'envelope' of a PDL/PD pair.", "type": "object", "properties": { "type": { "const": "pdEnvelope" }, @@ -196,8 +184,7 @@ "required": [ "minimum", "maximum" ] }, "simpleType": { - "description": "Simple type that has no fields other than a name and - type.", + "description": "Simple type that has no fields other than a name and type.", "type": "object", "properties": { "name": { "$ref": "#/definitions/nameType" }, @@ -263,4 +250,4 @@ "set_response": [ "set_request" ], "set_subdevice_range" : [ "set_request", "set_response" ] } -} \ No newline at end of file +} From 75d6d72090228b86375c1d3d69b3f9776395eed8 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 11:18:15 +0100 Subject: [PATCH 04/13] Don't check maxlen as we can't line wrap in JSON --- .jshintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.jshintrc b/.jshintrc index a3ad17f..6f9bf81 100644 --- a/.jshintrc +++ b/.jshintrc @@ -19,7 +19,6 @@ "immed": true, "browser": false, "es3": true, - "maxlen": 80, "nonbsp": true, "freeze": true, "node": true, From 319b23c203c81e679f67fc657be2d8ac0b4171d8 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 11:43:54 +0100 Subject: [PATCH 05/13] Fix a typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e843f40..30818d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ before_install: - if [[ "$TASK" == "spellintian" ]]; then sudo add-apt-repository ppa:waja/trusty-backports -y; sudo apt-get update -qq; sudo apt-get install lintian -y; fi # Install a late enough lintian install: - - if [ "$TASK" = "codespell" ]; then npm install -g grunt-cli; fi + - if [ "$TASK" = "npm-test" ]; then npm install -g grunt-cli; fi - if [ "$TASK" = "npm-test" ]; then npm install; fi - if [ "$TASK" = "codespell" ]; then pip install urllib3[secure]; fi - if [ "$TASK" = "codespell" ]; then sudo pip install --upgrade git+https://github.com/codespell-project/codespell.git; fi From d7d3d6aca661112d5ce56d7f915fa47ad3df21fb Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 12:28:48 +0100 Subject: [PATCH 06/13] Temporarily switch to my branch of grunt-jsonschema-ajv --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c531b2..01e876d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "grunt": "^1.0.0", "grunt-contrib-jshint": "^0.12.0", - "grunt-jsonschema-ajv": "^0.1.0", + "grunt-jsonschema-ajv": github:peternewman/grunt-jsonschema-ajv#travis, "ajv": "^6.10.2" }, "scripts": { From 6f845be56884a52c9384e9d7a4619cf51f85a434 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 12:31:10 +0100 Subject: [PATCH 07/13] Quote the dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 01e876d..6e163a4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "grunt": "^1.0.0", "grunt-contrib-jshint": "^0.12.0", - "grunt-jsonschema-ajv": github:peternewman/grunt-jsonschema-ajv#travis, + "grunt-jsonschema-ajv": "github:peternewman/grunt-jsonschema-ajv#travis", "ajv": "^6.10.2" }, "scripts": { From 64a0865a84e49f95dd9281fb78319588460bc1d7 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 12:39:23 +0100 Subject: [PATCH 08/13] Don't use a cache for now while we're testing stuff --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30818d8..f6073ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ language: node_js node_js: - stable -cache: - directories: - - $HOME/.npm +#cache: +# directories: +# - $HOME/.npm before_install: - if [[ "$TASK" == "spellintian" ]]; then sudo add-apt-repository ppa:waja/trusty-backports -y; sudo apt-get update -qq; sudo apt-get install lintian -y; fi # Install a late enough lintian From 1257837c21fa4ec3f63cc4a9472ed1fb767f47d4 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 12:57:18 +0100 Subject: [PATCH 09/13] Turn caching back on as it seems to do it anyway --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6073ff..30818d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ language: node_js node_js: - stable -#cache: -# directories: -# - $HOME/.npm +cache: + directories: + - $HOME/.npm before_install: - if [[ "$TASK" == "spellintian" ]]; then sudo add-apt-repository ppa:waja/trusty-backports -y; sudo apt-get update -qq; sudo apt-get install lintian -y; fi # Install a late enough lintian From 4078e321616833f52956d65feca602319b0c3395 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 14:05:21 +0100 Subject: [PATCH 10/13] Turn on debug --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e163a4..81d15b2 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,6 @@ "ajv": "^6.10.2" }, "scripts": { - "test": "grunt --verbose --stack" + "test": "grunt --verbose --debug --stack" } } From 3ef380926504e1b65c9dcf3eacd8e691a74d2659 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 15:11:00 +0100 Subject: [PATCH 11/13] subdeviceType should never be in oneOfTypes It's only used to define which subdevices a command should be targeted at --- schema.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/schema.json b/schema.json index fc8b436..c18d93f 100644 --- a/schema.json +++ b/schema.json @@ -141,8 +141,7 @@ { "$ref": "#/definitions/listType" }, { "$ref": "#/definitions/pdEnvelopeType" }, { "$ref": "#/definitions/simpleType" }, - { "$ref": "#/definitions/stringType" }, - { "$ref": "#/definitions/subdeviceType" } + { "$ref": "#/definitions/stringType" } ] }, "subdeviceType": { From 6e2df62423496fecadb8f9ea3ec9e302d8b2e51f Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 15:24:28 +0100 Subject: [PATCH 12/13] Attempt to update examples to match new schema --- data/bitfields.json | 32 ++++++-------- data/device_info.json | 64 +++++++++++++-------------- data/dmx_start_address.json | 88 +++++++++++++++++-------------------- data/proxied_devices.json | 32 ++++++-------- 4 files changed, 98 insertions(+), 118 deletions(-) diff --git a/data/bitfields.json b/data/bitfields.json index 67dd2b7..a7ac8d8 100644 --- a/data/bitfields.json +++ b/data/bitfields.json @@ -2,22 +2,18 @@ "name": "PROXIED_DEVICES", "pid": 16, "version": 1, - "get_request": { - "fields": [] - }, - "get_response": { - "fields": [ - { - "type": "bitfield", - "size": 8, - "bits": [ - { - "index": 0, - "name": "foo" - } - ] - } - ] - }, - "get_subdevice_range": 0 + "get_request": [], + "get_response": [ + { + "type": "bitfield", + "size": 8, + "bits": [ + { + "index": 0, + "name": "foo" + } + ] + } + ], + "get_subdevice_range": "root" } diff --git a/data/device_info.json b/data/device_info.json index 320f463..929e1da 100644 --- a/data/device_info.json +++ b/data/device_info.json @@ -2,38 +2,34 @@ "name": "DEVICE_INFO", "pid": 96, "version": 1, - "get_request": { - "fields": [] - }, - "get_response": { - "fields": [ - {"name": "protocol_major", "type": "uint8"}, - {"name": "protocol_minor", "type": "uint8"}, - {"name": "device_model", "type": "uint16"}, - {"name": "product_category", "type": "uint16"}, - {"name": "software_version", "type": "uint32"}, - { - "name": "dmx_footprint", - "type": "uint16", - "ranges": [ - { - "lower": 0, - "upper": 512 - } - ], - "labels": [ - { - "label": "No footprint", - "value": 65535 - } - ] - }, - {"name": "current_personality", "type": "uint8"}, - {"name": "personality_count", "type": "uint8"}, - {"name": "dmx_start_address", "type": "uint16"}, - {"name": "sub_device_count", "type": "uint16"}, - {"name": "sensor_count", "type": "uint8"} - ] - }, - "get_subdevice_range": 2 + "get_request": [], + "get_response": [ + {"name": "protocol_major", "type": "uint8"}, + {"name": "protocol_minor", "type": "uint8"}, + {"name": "device_model", "type": "uint16"}, + {"name": "product_category", "type": "uint16"}, + {"name": "software_version", "type": "uint32"}, + { + "name": "dmx_footprint", + "type": "uint16", + "ranges": [ + { + "lower": 0, + "upper": 512 + } + ], + "labels": [ + { + "label": "No footprint", + "value": 65535 + } + ] + }, + {"name": "current_personality", "type": "uint8"}, + {"name": "personality_count", "type": "uint8"}, + {"name": "dmx_start_address", "type": "uint16"}, + {"name": "sub_device_count", "type": "uint16"}, + {"name": "sensor_count", "type": "uint8"} + ], + "get_subdevice_range": "root_or_any_subdevice" } diff --git a/data/dmx_start_address.json b/data/dmx_start_address.json index 5acf044..58d241f 100644 --- a/data/dmx_start_address.json +++ b/data/dmx_start_address.json @@ -2,52 +2,44 @@ "name": "DMX_START_ADDRESS", "pid": 240, "version": 1, - "get_request": { - "fields": [] - }, - "get_response": { - "fields": [ - { - "name": "start_address", - "type": "uint16", - "ranges": [ - { - "lower": 0, - "upper": 512 - } - ], - "labels": [ - { - "label": "No footprint", - "value": 65535 - } - ] - } - ] - }, - "get_subdevice_range": 2, - "set_request": { - "fields": [ - { - "name": "start_address", - "type": "uint16", - "ranges": [ - { - "lower": 0, - "upper": 512 - } - ], - "labels": [ - { - "label": "No footprint", - "value": 65535 - } - ] - } - ] - }, - "set_response": { - "fields": [] - }, - "set_subdevice_range": 3 + "get_request": [], + "get_response": [ + { + "name": "start_address", + "type": "uint16", + "ranges": [ + { + "lower": 0, + "upper": 512 + } + ], + "labels": [ + { + "label": "No footprint", + "value": 65535 + } + ] + } + ], + "get_subdevice_range": "root_or_any_subdevice", + "set_request": [ + { + "name": "start_address", + "type": "uint16", + "ranges": [ + { + "lower": 0, + "upper": 512 + } + ], + "labels": [ + { + "label": "No footprint", + "value": 65535 + } + ] + } + ], + "set_response": [], + "set_subdevice_range": "root_or_any_subdevice_or_broadcast" } diff --git a/data/proxied_devices.json b/data/proxied_devices.json index 768260d..85c03eb 100644 --- a/data/proxied_devices.json +++ b/data/proxied_devices.json @@ -2,22 +2,18 @@ "name": "PROXIED_DEVICES", "pid": 16, "version": 1, - "get_request": { - "fields": [] - }, - "get_response": { - "fields": [ - { - "name": "devices", - "type": "group", - "fields": [ - { - "name": "uid", - "type": "uid" - } - ] - } - ] - }, - "get_subdevice_range": 2 + "get_request": [], + "get_response": [ + { + "name": "devices", + "type": "group", + "fields": [ + { + "name": "uid", + "type": "uid" + } + ] + } + ], + "get_subdevice_range": "root_or_any_subdevice" } From 8ddc98a03b60fc537ec1f48d321d2a4d574b6a69 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sat, 7 Sep 2019 17:58:07 +0100 Subject: [PATCH 13/13] Update remaining examples to match the new schema --- data/bitfields.json | 2 +- data/device_info.json | 4 ++-- data/dmx_start_address.json | 8 ++++---- data/proxied_devices.json | 8 +++----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/data/bitfields.json b/data/bitfields.json index a7ac8d8..1a27f67 100644 --- a/data/bitfields.json +++ b/data/bitfields.json @@ -5,7 +5,7 @@ "get_request": [], "get_response": [ { - "type": "bitfield", + "type": "bitField", "size": 8, "bits": [ { diff --git a/data/device_info.json b/data/device_info.json index 929e1da..b514d35 100644 --- a/data/device_info.json +++ b/data/device_info.json @@ -14,8 +14,8 @@ "type": "uint16", "ranges": [ { - "lower": 0, - "upper": 512 + "minimum": 0, + "maximum": 512 } ], "labels": [ diff --git a/data/dmx_start_address.json b/data/dmx_start_address.json index 58d241f..524c40f 100644 --- a/data/dmx_start_address.json +++ b/data/dmx_start_address.json @@ -9,8 +9,8 @@ "type": "uint16", "ranges": [ { - "lower": 0, - "upper": 512 + "minimum": 0, + "maximum": 512 } ], "labels": [ @@ -28,8 +28,8 @@ "type": "uint16", "ranges": [ { - "lower": 0, - "upper": 512 + "minimum": 0, + "maximum": 512 } ], "labels": [ diff --git a/data/proxied_devices.json b/data/proxied_devices.json index 85c03eb..ca04790 100644 --- a/data/proxied_devices.json +++ b/data/proxied_devices.json @@ -6,13 +6,11 @@ "get_response": [ { "name": "devices", - "type": "group", - "fields": [ - { + "type": "list", + "itemType": { "name": "uid", "type": "uid" - } - ] + } } ], "get_subdevice_range": "root_or_any_subdevice"