Closed paolobelluticm closed 1 year ago
Validation error returned by JSON Schema Validator while validating both the official StateReport event example and the ChangeReport event example from the documentation:
Message: Invalid type. Expected Number but got String. Schema path: #/definitions/state.properties/items/anyOf/31/properties/value/type
The issue is that the schema expects RangeController's rangeValue property to be a number, while in the examples it's a string. Who's at fault here?
Relevant fragment of the event:
{ "namespace": "Alexa.RangeController", "instance": "Fan.Speed", "name": "rangeValue", "value": "10", "timeOfSample": "2017-02-03T16:20:50.52Z", "uncertaintyInMilliseconds": 500 },
Relevant fragment of the validation schema (lines 1723-1740):
"properties": { "namespace": { "enum": [ "Alexa.RangeController" ] }, "name": { "enum": [ "rangeValue" ] }, "instance": { "type": "string" }, "value": { "type": "number", "additionalProperties": false, "format": "double" },
If I change "type" to "string", the validation obviously succeeds.
I've been responding with a string for some time, and it seems to work. Should I bother switching to a number to please the validation schema?
The official documentation's examples currently show range values as numbers instead of strings. Perhaps the documentation was updated.
Technical documentation is now updated. Closing this issue now.
Validation error returned by JSON Schema Validator while validating both the official StateReport event example and the ChangeReport event example from the documentation:
The issue is that the schema expects RangeController's rangeValue property to be a number, while in the examples it's a string. Who's at fault here?
Relevant fragment of the event:
Relevant fragment of the validation schema (lines 1723-1740):
If I change "type" to "string", the validation obviously succeeds.
I've been responding with a string for some time, and it seems to work. Should I bother switching to a number to please the validation schema?