-
Notifications
You must be signed in to change notification settings - Fork 333
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
2.0 - Forms and Links href are not the same #3053
Comments
You're correct that links are being replaced by forms in many instances, this is in order to be compliant with W3C WoT standards. But what you're looking at here are two different API endpoints with two different purposes. The first endpoint is a Properties resource providing The second endpoint is a WebSocket resource which provides an alternate API for all operations on the device using WebSockets. This still exposes the legacy Web Thing WebSocket API. Whilst the WebSocket sub-protocol is being standardised via the Web Thing Protocol Community Group, in WoT Thing Description 1.1 there is still no way to properly express this endpoint using forms, which is why it's currently still a link. See #2882 and w3c/wot-thing-description#1070 for discussion around this. In summary: Property, Action, Event, Properties, Actions and Events resources will all switch from using links to using forms. The only links left will probably be:
Hope this makes sense. Note that this was all discussed in #2806 |
Wow, that's a very detailed explanation :-) I still don't understand 100%, but it's interesting. It clearly "works as designed". Thank you. |
Small practical question: in the "thing root" there is an attribute called "href" which does give the direct URL ending with the device ID. Then inside a property there is no similar "href". But here the forms can be used to extract the property ID. Aside from the spec, perhaps there could be a practical way for the gateway to give both ID's with one consistent method? With the Maybe properties could also have a Or even better: what if things have an Just thinking out loud. |
That's unfortunately what happens when you ask a W3C specification editor a simple question about a specification 😂
There is at the moment, but that's going away in 2.0, see #2856. The ID of the Thing is provided by its Note that the ID of the Thing is the full URL, not just the fragment at the end which may be of interest to an adapter add-on.
Every PropertyAffordance has a Form with a Note that the URL structure is not standardised in the W3C specification so that assumption only works for WebThings Gateway. There's no such thing as a "property ID" in the W3C specification, only the key of its PropertyAffordance in the properties Map and one or more
First of all, I'm currently in the process of trying to remove anything non-standard from Thing Descriptions so I'd rather not add anything new if not necessary. Anything we need to keep (like
Forms provide exactly the same thing, though it's risky to assume it's the first form in the array. Technically you should check that it's an HTTP URL and doesn't have a different
What would that contain that would be any different to the key of the PropertyAffordance in the properties Map or the last fragment of the
Feel free to make suggestions to the W3C WoT Working Group! As you can see, there are lots of changes coming to the API in 2.0, so I don't recommend programming against that unless you've familiarised yourself with the latest drafts of the WoT Thing Description, WoT Discovery and WoT Profile specifications because you may be making incorrect assumptions about what terms in the Thing Description mean. Those specifications don't make for light reading so I plan to write some simpler documentation of the gateway's API once the implementation is complete, along the lines of the current Web Thing API document but more like an MDN style explainer of the W3C specifications. |
This could very well be a bug in the Candle code, but I thought I'd share since I can't imagine how the minute differences in Candle could have caused this.
In the screenshot below you can see how the
forms
href has an unexpected "properties" at the end:My assumption is that "forms is the new links", and that for 2.0 the idea is that forms will be prefered, and that the hrefs should match. Is that correct?
The text was updated successfully, but these errors were encountered: