Blocks: #2802
Currently for a property definition in a Thing Description exposed by the gateway as below:
...
"temperature": {
"type": "number",
"links": [{"href": "/things/pi/properties/temperature"}]
}
...
a response to a GET request on the Property resource looks something like:
where the payload is a JSON object with a map representation of the property's name and value. The payloads of PUT requests and responses also follow the same format.
To be compliant with the W3C Thing Description specification, let's change payloads to match the data schema in the Thing Description, e.g. for the above example this would simply be:
See WebThingsIO/api#143 for some background on this topic.
This includes:
- Removing object wrappers from HTTP requests and responses on a Property resource when reading and writing properties
- Removing object wrappers from HTTP requests and responses when invoking an action on an Action resource
- Updating the gateway's front end to expect this
The excludes:
- Removing object wrappers from Properties resources (I seem to recall the W3C specification actually defined an object wrapper for
readallproperties and writeallproperties ops with values keyed by property names, but I can't find it in the current draft, can anyone confirm this?)
- Changing the payload of the Things resource, which will hopefully be defined in the WoT Discovery specification as part of the Directory Service API
- Changing payloads of any messages in the WebSocket API, which need the additional context
Open questions:
- What should we do about Event resources, which currently return an array of objects in their HTTP response?
- What should we do about Events resources, which currently don't have an obvious representation which is W3C compliant?
- What should we do about Action resources which represent an action queue?
- What should we do about Actions resources?
Blocks: #2802
Currently for a property definition in a Thing Description exposed by the gateway as below:
a response to a GET request on the Property resource looks something like:
{ "temperature": 21 }where the payload is a JSON object with a map representation of the property's name and value. The payloads of PUT requests and responses also follow the same format.
To be compliant with the W3C Thing Description specification, let's change payloads to match the data schema in the Thing Description, e.g. for the above example this would simply be:
21See WebThingsIO/api#143 for some background on this topic.
This includes:
The excludes:
readallpropertiesandwriteallpropertiesops with values keyed by property names, but I can't find it in the current draft, can anyone confirm this?)Open questions: