Closed
Description
When consuming a Thing Description the op values are not properly filled for a property. Example is below.
- I consume a simplified version of TestThing with only bool property.
{
"id": "urn:dev:wot:org:w3:testthing:lyon2018",
"title": "TestThing",
"@context": "https://www.w3.org/2019/wot/td/v1",
"@type": "Thing",
"security": [
"nosec_sc"
],
"properties": {
"bool": {
"title": "true/false",
"type": "boolean",
"readOnly": false,
"writeOnly": false,
"observable": false,
"forms": [
{
"href": "http://plugfest.thingweb.io:8083/TestThing/properties/bool",
"contentType": "application/json",
"op": [
"readproperty",
"writeproperty"
]
}
]
}
},
"securityDefinitions": {
"nosec_sc": {
"scheme": "nosec"
}
}
}
When I do writeProperty()
everything works as expected.
- When I remove
readOnly
,writeOnly
,observable
, they are inserted by default. When I dowriteProperty()
everything works as expected. - When I remove the whole
op
array and dowriteProperty()
everything works as expected. However when I inspect the Thing Description after consumption theop
values are not inserted per default. - The real problem is the op insertion. If I remove only
writeproperty
from the op array,writeProperty()
fails.
The Thing Description that fails is the following:
{
"id": "urn:dev:wot:org:w3:testthing:lyon2018",
"title": "TestThing",
"@context": "https://www.w3.org/2019/wot/td/v1",
"@type": "Thing",
"security": [
"nosec_sc"
],
"properties": {
"bool": {
"title": "true/false",
"type": "boolean",
"readOnly": false,
"writeOnly": false,
"observable": false,
"forms": [
{
"href": "http://plugfest.thingweb.io:8083/TestThing/properties/bool",
"contentType": "application/json",
"op": [
"readproperty"
]
}
]
}
},
"securityDefinitions": {
"nosec_sc": {
"scheme": "nosec"
}
}
}
The TD Spec here defines default values for op. I think op should always be generated and in case of missing elements should be filled according to the default value definitions.
Metadata
Metadata
Assignees
Labels
No labels