-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
op does not have with default tag anymore #1192
Comments
thanks for the pointer. I will fix this in the next update |
I would personally prefer to keep this "bug". See #878. |
issue solved |
This change has created a blocker in making WebThings W3C compliant, as discussed in #878. Was that taken into account before merging #1262? The issue lies with how to express a WebSocket endpoint in a Thing Description which is shared for all interaction affordances. Our conclusion from that discussion had been that we could provide a simple form for the top level WebSocket endpoint with no "forms": [
{
"href": "wss://foo.webthings.io/things/lamp",
"subprotocol": "webthing"
}
] If "forms": [
{
"href": "wss://foo.webthings.io/things/lamp",
"subprotocol": "webthing",
"op": ["writeproperty", "invokeaction", "queryaction", "subscribeevent", "writeallproperties", "writemultipleproperties", "observeallproperties", "queryallactions", "subscribeallevents"]
}
] Without either {
"@context": [
"https://www.w3.org/2019/wot/td/v1",
"https://webthings.io/schemas/"
],
"@type": ["Light", "OnOffSwitch"],
"id": "https://user1.webthings.io/things/lamp1/",
"title": "My Lamp",
"description": "A web connected lamp",
"base": "https://user1.webthings.io/things/lamp1/",
"securityDefinitions": { ... },
"security": "oauth2",
"properties": {
"on": {
"@type": "OnOffProperty",
"type": "boolean",
"title": "On/Off",
"description": "Whether the lamp is turned on",
"forms": [
{
"href": "properties/on"
},
{
"href": "wss://user1.webthings.io/things/lamp1",
"subprotocol": "webthing",
"op": "writeproperty"
}
],
},
"brightness" : {
"@type": "BrightnessProperty",
"type": "integer",
"title": "Brightness",
"description": "The level of light from 0-100",
"minimum" : 0,
"maximum" : 100,
"forms": [
{
"href": "properties/brightness"
},
{
"href": "wss://user1.webthings.io/things/lamp1",
"subprotocol": "webthing",
"op": "writeproperty"
}
],
}
},
"actions": {
"fade": {
"@type": "FadeAction",
"title": "Fade",
"description": "Fade the lamp to a given level",
"input": {
"type": "object",
"properties": {
"level": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"duration": {
"type": "integer",
"minimum": 0,
"unit": "milliseconds"
}
}
},
"forms": [
{
"href": "actions/fade"
},
{
"href": "wss://user1.webthings.io/things/lamp1",
"subprotocol": "webthing",
"op": ["invokeaction", "queryaction"]
}
],
}
},
"events": {
"overheated": {
"title": "Overheated",
"@type": "OverheatedEvent",
"data": {
"type": "number",
"unit": "degree celsius"
},
"description": "The lamp has exceeded its safe operating temperature",
"forms": [
{
"href": "events/overheated",
"subprotocol": "sse",
},
{
"href": "wss://user1.webthings.io/things/lamp1",
"subprotocol": "webthing",
"op": "subscribeevent"
}
],
}
},
"forms": [
{
"op": "readallproperties"
"href": "properties"
},
{
"op": "queryallactions"
"href": "actions"
},
{
"op": "subscribeallevents",
"href": "events",
"subprotocol": "sse",
},
{
"href": "wss://user1.webthings.io/things/lamp1",
"subprotocol": "webthing",
"op": ["writeallproperties", "writemultipleproperties", "observeallproperties", "queryallactions", "subscribeallevents"]
}
],
"links": [
{
"rel": "alternate",
"type": "text/html",
"href": ""
}
]
} In order to unblock us I can see 3 solutions:
"links": [
{
"rel": "alternate",
"href": "wss://foo.webthings.io/things/lamp"
}
] |
This is related to the whole protocol overhaul and a concrete use-case for connected protocols (websocket protocols) |
The REC version has the
with default
assignment for theop
in the forms (see screenshot below).However, the editor spec says optional (see below) which means that it can be totally omitted. This is a bug in my opinion.
The text was updated successfully, but these errors were encountered: