diff --git a/index.html b/index.html index 75f3ab6d..c5e2f63d 100644 --- a/index.html +++ b/index.html @@ -316,7 +316,7 @@

The ThingDescription type

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 @@

The ThingDescription type

To validate a TD given |td:ThingDescription|, run the following steps:
  1. - If |td| is not an object, [= exception/throw =] a - {{"TypeError"}} and abort these steps. -
  2. -
  3. - If any of the mandatory properties defined in [[!WOT-TD]] for - Thing - that don't have default definitions - are missing from |td|, [= exception/throw =] a - {{"TypeError"}} and abort these steps. -
  4. -
  5. - If JSON schema validation fails on |td|, [= exception/throw =] a - {{"TypeError"}} and abort these steps. + If JSON schema + validation fails on |td|, [= exception/throw =] a {{"TypeError"}} and abort these steps.
+

+ Additional steps may be added to fill the default values of mandatory fields. +