Skip to content

Commit 6067198

Browse files
committed
Add more English descriptions
1 parent 20a195e commit 6067198

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
@@ -966,10 +966,19 @@
966966
as it is not always possible to tell whether a template will resolve
967967
to a full URI or a URI-reference.
968968
</t>
969+
<t>
970+
In English, the high-level algorithm is:
971+
<list>
972+
<t>Populate template variable data from the instance</t>
973+
<t>If input is desired, accept input</t>
974+
<t>Check that all required variables have a value</t>
975+
<t>Encode values into strings and fill out the template</t>
976+
</list>
977+
</t>
969978
<figure>
970979
<preamble>
971-
This is the high-level algorithm. "T" comes from either "href"
972-
or "anchor" within the LDO, or from "base" in a containing schema.
980+
This is the high-level algorithm as pseudocode. "T" comes from either
981+
"href" or "anchor" within the LDO, or from "base" in a containing schema.
973982
Pseudocode for each step follows.
974983
</preamble>
975984
<artwork>
@@ -992,6 +1001,17 @@ R = rfc6570ResolutionAlgorithm(T, templateData)
9921001
</figure>
9931002

9941003
<section title="Populating template data from the instance">
1004+
<t>
1005+
This step looks at various data sources in the instance:
1006+
<list>
1007+
<t>Use "templatePointers" to find values where appropriate</t>
1008+
<t>Look in the immediate instance for remaining values</t>
1009+
<t>
1010+
Either way, if there is a value there, put it in the
1011+
template resolution data set
1012+
</t>
1013+
</list>
1014+
</t>
9951015
<figure>
9961016
<artwork>
9971017
<![CDATA[
@@ -1014,6 +1034,27 @@ for varname in T:
10141034
</section>
10151035

10161036
<section title="Accepting input for template data">
1037+
<t>
1038+
This step is relatively complex, as there are several cases to support.
1039+
Some variables will forbid input and some will allow it. Some will
1040+
have initial values that need to be presented in the input interface,
1041+
and some will not.
1042+
</t>
1043+
<t>
1044+
<list>
1045+
<t>Figure out which variables can accept input</t>
1046+
<t>
1047+
Pre-populate the input data set if the template resolution data
1048+
set has a value
1049+
</t>
1050+
<t>Accept input (present a web form, make a callback, etc.)</t>
1051+
<t>Validate the input data set, (not the template resolution data set)</t>
1052+
<t>
1053+
Put the input in the template resolution data set, overriding
1054+
any existing values
1055+
</t>
1056+
</list>
1057+
</t>
10171058
<figure>
10181059
<preamble>
10191060
"InputForm" represents whatevers sort of input mechanism is appropriate.
@@ -1057,6 +1098,11 @@ return inputData:
10571098
</section>
10581099

10591100
<section title="Encoding data as strings">
1101+
<t>
1102+
This section is straightforward, converting literals to their names
1103+
as strings, and converting numbers to strings in the most obvious manner,
1104+
and percent-encoding as needed for use in the URI.
1105+
</t>
10601106
<figure>
10611107
<artwork>
10621108
<![CDATA[

0 commit comments

Comments
 (0)