Skip to content
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

Change WebSocket endpoints from links to forms in Thing Descriptions #2882

Open
benfrancis opened this issue Sep 30, 2021 · 2 comments
Open
Labels
w3c-compliance wot-thing-description W3C WoT Thing Description specification
Milestone

Comments

@benfrancis
Copy link
Member

I think the W3C WoT Working Group's conclusion in w3c/wot-thing-description#878 is that it's OK to have a single top level form for a WebSocket endpoint, with no op member.

This means that if we want to we can change the current top level link for WebSocket endpoints exposed by the gateway:

    "links": [
        {
            "rel": "alternate",
            "href": "ws://localhost:8080/things/virtual-things-10"
        }
    ],

into a form:

    "forms": [
        {
            "href": "ws://localhost:8080/things/virtual-things-10"
        }
    ],
@benfrancis benfrancis added this to the 2.0 milestone Sep 30, 2021
@benfrancis benfrancis added this to Triage in WebThings Gateway via automation Sep 30, 2021
@benfrancis benfrancis added the wot-thing-description W3C WoT Thing Description specification label Nov 22, 2021
@benfrancis
Copy link
Member Author

think the W3C WoT Working Group's conclusion in w3c/wot-thing-description#878 is that it's OK to have a single top level form for a WebSocket endpoint, with no op member.

This is no longer the case, see w3c/wot-thing-description#1192 (comment).

  1. Forms are mandatory for all interaction affordances
  2. The op member is considered a mandatory (with defaults) of all forms
  3. A top level form is limited to a finite set of operation types which only includes meta operations

The upshot of this is that we either need to:

  1. Add a form to every individual interaction affordance which specifies the same WebSocket URL but different op values
  2. Leave WebSocket endpoints as links rather than forms

The former creates a lot of redundancy and duplication of metadata and there isn't a clear mapping of operations onto the current Web Thing WebSocket sub-protocol.

The latter is much simpler but is unlikely to be understood by third party WoT consumers.

I'm tempted to leave them as links for now, and switch to forms once the Web Thing Protocol Community Group has a W3C version of the WebSocket subprotocol which better maps onto the set of WoT operations and can ultimately be formally registered as a WebSocket subprotocol with IANA.

@benfrancis
Copy link
Member Author

benfrancis commented Apr 14, 2023

Note that there is some work planned in the next WoT Working Group charter to better support re-usable connections to enable less verbose Thing Descriptions (in WoT Thing Description 2.0), see https://w3c.github.io/wot-charter-drafts/wot-wg-2023-details.html#init-connection-workitem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
w3c-compliance wot-thing-description W3C WoT Thing Description specification
Projects
Development

No branches or pull requests

1 participant