Skip to content

Commit 13b1a24

Browse files
committed
Use DataSchemaValue to differentiate from TD DataSchema
Signed-off-by: Zoltan Kis <[email protected]>
1 parent 7dd8175 commit 13b1a24

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

index.html

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -487,25 +487,29 @@ <h2>The <dfn>WoT API object</dfn></h2>
487487
<section data-dfn-for="InteractionInput">
488488
<h2>The <dfn>InteractionInput</dfn> type</h2>
489489
<pre class="idl">
490-
typedef any DataSchema;
491-
typedef (ReadableStream or DataSchema) InteractionInput;
490+
typedef any DataSchemaValue;
491+
typedef (ReadableStream or DataSchemaValue) InteractionInput;
492492
</pre>
493493
<p>
494494
Belongs to the <a>WoT Consumer</a> conformance class and represents the
495495
<a>WoT Interaction</a> data provided by application scripts to the UA.
496-
It is either a {{ReadableStream}} object, or an
497-
<a href="https://www.ecma-international.org/ecma-262/11.0/index.html#sec-ecmascript-data-types-and-values">ECMAScript value</a> (i.e. null, boolean, number, string, array, or object).
496+
</p>
497+
<p>
498+
<dfn>DataSchemaValue</dfn> is an
499+
<a href="https://www.ecma-international.org/ecma-262/11.0/index.html#sec-ecmascript-data-types-and-values">ECMAScript value</a> that is accepted for <a>DataSchema</a> defined in [[WoT-TD]]
500+
(i.e. null, boolean, number, string, array, or object).
498501
</p>
499502
<p>
500503
{{ReadableStream}} is meant to be used for <a>WoT Interactions</a> that
501-
don't have a {{DataSchema}} in the <a>Thing Description</a>, only a
504+
don't have a <a>DataSchema</a> in the <a>Thing Description</a>, only a
502505
{{Form}}'s `contentType` that can be represented by a stream.
503506
</p>
504507
<p>
505-
Any <a href="https://www.ecma-international.org/ecma-262/11.0/index.html#sec-ecmascript-data-types-and-values">ECMAScript value</a> may
506-
be used for <a>WoT Interactions</a> that have a {{DataSchema}} defined in
507-
the <a>Thing Description</a>, or which can be mapped by implementations
508-
to the {{Form}}'s `contentType` defined in the <a>Thing Description</a>.
508+
In practice, any
509+
<a href="https://www.ecma-international.org/ecma-262/11.0/index.html#sec-ecmascript-data-types-and-values">ECMAScript value</a> may be used for <a>WoT Interactions</a> that have a
510+
<a>DataSchema</a> defined in the <a>Thing Description</a>,
511+
or which can be mapped by implementations to the {{Form}}'s `contentType`
512+
defined in the <a>Thing Description</a>.
509513
</p>
510514
<p>
511515
The algorithms in this document specify how exactly input data is used in
@@ -525,7 +529,7 @@ <h2>The <dfn>InteractionOutput</dfn> interface</h2>
525529
This interface exposes a convenience function which should work in
526530
the vast majority of IoT use cases: the
527531
<a href="#the-value-function">value()</a> function. Its implementation
528-
will inspect the data, parse it if adheres to a {{DataSchema}}, or
532+
will inspect the data, parse it if adheres to a <a>DataSchema</a>, or
529533
otherwise fail early, leaving the underlying stream undisturbed so
530534
that application scripts could attempt reading the stream themselves, or
531535
handling the data as {{ArrayBuffer}}.
@@ -557,7 +561,7 @@ <h2>The <dfn>InteractionOutput</dfn> interface</h2>
557561
</p>
558562
<p>
559563
The <dfn>schema</dfn> attribute represents the <a>DataSchema</a>
560-
of the payload as a {{JSON}} object, initially `null`.
564+
(defined in [[WoT-TD]]) of the payload as a {{JSON}} object, initially `null`.
561565
</p>
562566
<p>
563567
The <dfn>[[\value]]</dfn> internal slot represents the parsed value of
@@ -1792,7 +1796,7 @@ <h3>The <dfn>PropertyReadHandler</dfn> callback</h3>
17921796
<a>Property</a> is received and defines what to do with such requests.
17931797
It returns a {{Promise}} and resolves with an {{ReadableStream}} object or an
17941798
<a href="https://www.ecma-international.org/ecma-262/11.0/index.html#sec-ecmascript-data-types-and-values">
1795-
ECMAScript value</a> conforming to {{DataSchema}}, or rejects with an
1799+
ECMAScript value</a> conforming to <a>DataSchema</a>, or rejects with an
17961800
error if the property is not found or the value cannot be retrieved.
17971801
</p>
17981802
</section>
@@ -1887,7 +1891,7 @@ <h3>The <dfn>PropertyReadHandler</dfn> callback</h3>
18871891
<li>
18881892
Return |value|.
18891893
<p class="note">
1890-
The |value| returned here SHOULD either conform to {{DataSchema}}
1894+
The |value| returned here SHOULD either conform to <a>DataSchema</a>
18911895
or it SHOULD be an {{ReadableStream}} object created by the
18921896
|handler|.
18931897
</p>
@@ -2168,7 +2172,7 @@ <h3>The <dfn>PropertyWriteHandler</dfn> callback</h3>
21682172
<p class="note">
21692173
The value is provided by implementations as an {{InteractionOutput}} object
21702174
in order to be able to represent values that are not described by a
2171-
{{DataSchema}}, such as streams.
2175+
<a>DataSchema</a>, such as streams.
21722176
</p>
21732177
</section>
21742178

0 commit comments

Comments
 (0)