-
Notifications
You must be signed in to change notification settings - Fork 28
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
Partial TD validation for input of produce() method #212
Comments
Some initial thoughts:
After this, an empty object becomes a valid input so maybe it should require something. At the same time, it can be thought that an empty object produces a default Thing that can be similar to the Servient Thing of node-wot. Note: When I say not require, an implementation can still decide to use it. |
Well, the input data for produce() should be a subset of the TD, plus eventually other info that needs standardizing (for instance security initializations etc). However, we will start without the latter. In addition, erroneous input would be just ignored. A script can always check the result by analysing the result of getThingDescription(). |
The main point being that it should be different than the "validating a TD" algorithm which is currently used. |
I think that the word subset might something we don't want to use depending on what it exactly means. I could think of two meanings:
I think that the second one is what we want to have. Its validation can be also done easily by simply removing the |
I agree that some kind of validation is possible and I prefer the second point.
About this, I think is better not to replicate the same actions and properties of the servient runtime. The default |
Yes, that is the idea. |
Just as a note, id term is not mandatory anymore according to the TD spec. However, I think that title term would be a sensible minimum. |
After produce(), things can be in limbo, but after calling We did standardize that implementations "expand" the init dictionary with terms having a default value in the TD spec (when not specified), and also, all terms that are generated by bindings + local runtime are also expanded. We should indeed enumerate the latter (and provide create algorithms as well). Help is welcome there. |
Sorry, I miss that.
Maybe a naive solution, but we could use quite the same approach as for the expansion of TD spec. Bindings enumerate the default values (and filling rules if applicable) for their own vocabulary terms, then the implementation of a protocol binding must fill those values. So that we "distribute" the filling process to the specific protocol binding standardization. |
I think the situation improved a little bit after #289. However, this issue still contains interesting points:
The current algorithm does not require a value for title, but it drafts how it could be generated by the runtime. Related issue #300
The current spec in 6th step of produce seems to cover the generation of hrefs asking to the runtime possible values. What we are missing is a standard specification in the protocol bindings documents. |
Scripting Call 2021-08-02
|
I read through the issue and the spec, I think it is now solved. I opened w3c/wot-binding-templates#121 about how to generate a form given an affordance and a Protocol Template. |
Currently, the TD Validation method is used after the expose() method, which makes sense the exposed TD should be a valid TD according to the TD spec. However, the produce() method should specify that there is a certain validation needed for its input. I imagine that this would be a TD template or partial TD but what can be given as input should be specified.
The text was updated successfully, but these errors were encountered: