-
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
Add definitions for partialTD #289
Conversation
The first thing I asked myself, from the point of view of an external user not fully familiar with WoT TD, could we use simpler terms?
and explain in the text that |
At first, the suggestion seemed reasonable, but now I wonder if having yet another term to specify the same concept would increase the confusion. @danielpeintner what do you think? |
Another option could be to continue using the term |
Mhh, I tend to agree with Zoltan. We should not overly complicated it. |
I would avoid this option because
If we stick with that definition (wich works for every other aspect and I don't think we should change it) and leave the produce method signature like it is in the current document, we can't use a PartialTD as argument. In particular we cannot state the following:
It would be like saying that the input type is a Cat but you could use any Animal as input. |
The argument does make logical sense, but I still think A JS developer will see an object. They pass a generic JS object that satisfies the specified validation algorithm (which may consider partial TDs, full TDs, etc). Promise<ExposedThing> produce(object init); but usually this is not recommended. typedef object ThingInit;
Promise<ExposedThing> produce(ThingInit init); |
Well, something that worries me a bit is that I feel that we are being flexible but unclear at the same time. There are issues in node-wot that arise simply due to this confusion:
There can be some other ones that I don't remember but these were the recent ones. So if the discussion is about whether saying partialTD or not, I think that can be changed but saying
does not fix the problem. I think it should say that it accepts partial TDs and it is not guaranteed that a full TD is taken in its entirety. |
Totally agree with your comment @egekorkan , that's why I started a dedicated section where to describe how the runtime should treat the PartialTD to generate a valid TD (Implementing a PartialTD). The algorithm is still a WIP but I think we should answer also the questions contained in: |
Scripting Call 2021-01-25: replace we might improve algorithmns step-by-step (by means of JSON Schema, ?JSON Schema Patch?) |
The general approach looks good to me 👍 A general comment about the new section headers. We should use
I wonder how we can make best progress w.r.t. the remaining TODOs. Shall we try to look into some of those to start with? |
I tried to improve the algorithm for the generation of a TD from an Some issues that I have:
I am open to comments/suggestions. |
index.html
Outdated
<li>Return the result of applying |schema| to |init|</li> | ||
</ol> | ||
|
||
TODO: is there any property that we should still require? for example flow property is mandatory for oAuth Security |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the TODO, please use a <p class="issue"> </p>
or <p class="ednote"> </p>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good, with minor nits (commented separately).
In general, please use line breaks/wrap around 80 chars, in order to ease review.
Though we applied this quite intermittently in the past. Make a choice :)
Scripting Call 2021-02-08
|
Input from @mmccool about missing
I'll open two more issues to keep track of other comments/insights that came up during the security call. |
Scripting Call 2021-02-22
|
This PR introduces the new concept of a PartialTD defined in the architecture PR: w3c/wot-architecture#577.
The changes are heavier than I thought therefore I'd like to receive some feedback about the direction that I am taking.
As you can see I changed the argument type of the
produce
method toPartialTD
. This is because a Thing Description is also an instance of aPartialTD
; in fact, the validation algorithm would accept any valid TD.Another open point is how we transform a
PartialTD
to a validThing Description
. I tried to sketch an algorithm in this PR; please have look.Notice finally, how these changes affect the construction of an
ExposedThing
. Now the constructor has first to transform thePartialTD
and then extend the obtained TD with the default values.Fixes #287
Preview | Diff