-
Notifications
You must be signed in to change notification settings - Fork 28
Minor changes on chapters 4 and 5 #231
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
Changes from all commits
70eaa33
f0f928a
458332e
9ce7e50
8c948cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,7 +316,7 @@ <h2>The <dfn>ThingDescription</dfn> type</h2> | |
let res = await fetch('https://tds.mythings.biz/sensor11'); | ||
// ... additional checks possible on res.headers | ||
let td = await res.json(); | ||
let thing = new ConsumedThing(td); | ||
let thing = await WOT.consume(td); | ||
console.log("Thing name: " + thing.getThingDescription().title); | ||
} catch (err) { | ||
console.log("Fetching TD failed", err.message); | ||
|
@@ -350,21 +350,13 @@ <h2>The <dfn>ThingDescription</dfn> type</h2> | |
To <dfn>validate a TD</dfn> given |td:ThingDescription|, run the following steps: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same: I don't think algorithm names and params should be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, see my review. |
||
<ol> | ||
<li> | ||
If |td| is not an object, [= exception/throw =] a | ||
{{"TypeError"}} and abort these steps. | ||
</li> | ||
<li> | ||
If any of the mandatory properties defined in [[!WOT-TD]] for | ||
<a href="https://www.w3.org/TR/2019/CR-wot-thing-description-20190516/#thing">Thing</a> | ||
that don't have <a href="https://www.w3.org/TR/2019/CR-wot-thing-description-20190516/#sec-default-values">default definitions</a> | ||
are missing from |td|, [= exception/throw =] a | ||
{{"TypeError"}} and abort these steps. | ||
</li> | ||
<li> | ||
If <a href="https://www.w3.org/TR/2019/CR-wot-thing-description-20190516/#json-schema-for-validation">JSON schema validation</a> fails on |td|, [= exception/throw =] a | ||
{{"TypeError"}} and abort these steps. | ||
If <a href="https://www.w3.org/TR/2019/CR-wot-thing-description-20190516/#json-schema-for-validation">JSON schema | ||
validation</a> fails on |td|, [= exception/throw =] a {{"TypeError"}} and abort these steps. | ||
</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @egekorkan comment on this change:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd leave as it was. As far as I understand if a property is marked as required in JSONSchema even if it has a default value, it must appear in the validating object. However, I'd add a step to make the process a little bit clearer:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with the sequence proposed above. |
||
</ol> | ||
<p class="ednote" title="Handling default values"> | ||
Additional steps may be added to fill the default values of mandatory fields. | ||
</p> | ||
</div> | ||
</section> | ||
</section> | ||
|
Uh oh!
There was an error while loading. Please reload this page.