Skip to content

Commit 29afd33

Browse files
committed
Add more English descriptions
1 parent 6980d49 commit 29afd33

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

jsonschema-hyperschema.xml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,10 +1428,19 @@ GET /foo/
14281428
as it is not always possible to tell whether a template will resolve
14291429
to a full URI or a URI-reference.
14301430
</t>
1431+
<t>
1432+
In English, the high-level algorithm is:
1433+
<list>
1434+
<t>Populate template variable data from the instance</t>
1435+
<t>If input is desired, accept input</t>
1436+
<t>Check that all required variables have a value</t>
1437+
<t>Encode values into strings and fill out the template</t>
1438+
</list>
1439+
</t>
14311440
<figure>
14321441
<preamble>
1433-
This is the high-level algorithm. "T" comes from either "href"
1434-
or "anchor" within the LDO, or from "base" in a containing schema.
1442+
This is the high-level algorithm as pseudocode. "T" comes from either
1443+
"href" or "anchor" within the LDO, or from "base" in a containing schema.
14351444
Pseudocode for each step follows.
14361445
</preamble>
14371446
<artwork>
@@ -1454,6 +1463,17 @@ R = rfc6570ResolutionAlgorithm(T, templateData)
14541463
</figure>
14551464

14561465
<section title="Populating template data from the instance">
1466+
<t>
1467+
This step looks at various data sources in the instance:
1468+
<list>
1469+
<t>Use "templatePointers" to find values where appropriate</t>
1470+
<t>Look in the immediate instance for remaining values</t>
1471+
<t>
1472+
Either way, if there is a value there, put it in the
1473+
template resolution data set
1474+
</t>
1475+
</list>
1476+
</t>
14571477
<figure>
14581478
<artwork>
14591479
<![CDATA[
@@ -1476,6 +1496,27 @@ for varname in T:
14761496
</section>
14771497

14781498
<section title="Accepting input for template data">
1499+
<t>
1500+
This step is relatively complex, as there are several cases to support.
1501+
Some variables will forbid input and some will allow it. Some will
1502+
have initial values that need to be presented in the input interface,
1503+
and some will not.
1504+
</t>
1505+
<t>
1506+
<list>
1507+
<t>Figure out which variables can accept input</t>
1508+
<t>
1509+
Pre-populate the input data set if the template resolution data
1510+
set has a value
1511+
</t>
1512+
<t>Accept input (present a web form, make a callback, etc.)</t>
1513+
<t>Validate the input data set, (not the template resolution data set)</t>
1514+
<t>
1515+
Put the input in the template resolution data set, overriding
1516+
any existing values
1517+
</t>
1518+
</list>
1519+
</t>
14791520
<figure>
14801521
<preamble>
14811522
"InputForm" represents whatevers sort of input mechanism is appropriate.
@@ -1519,6 +1560,11 @@ return inputData:
15191560
</section>
15201561

15211562
<section title="Encoding data as strings">
1563+
<t>
1564+
This section is straightforward, converting literals to their names
1565+
as strings, and converting numbers to strings in the most obvious manner,
1566+
and percent-encoding as needed for use in the URI.
1567+
</t>
15221568
<figure>
15231569
<artwork>
15241570
<![CDATA[

0 commit comments

Comments
 (0)