|
399 | 399 | There are several ways that a client can use data can with a link:
|
400 | 400 | <list>
|
401 | 401 | <t> URI Template variables resolved from server-supplied instance data </t>
|
402 |
| - <t> URI Template variables resolved from client data </t> |
| 402 | + <t> URI Template variables resolved from user agent data </t> |
403 | 403 | <t> Replacing or modifying the target resource's representation </t>
|
404 | 404 | <t> Submitting data for processing, where the data has no
|
405 | 405 | inherent relation to the target resource's representation</t>
|
|
423 | 423 | <xref target="hrefSchema">"hrefSchema"</xref> allows a link to specify
|
424 | 424 | a schema for resolving template variables from client-supplied data.
|
425 | 425 | Regular JSON Schema validation features can be used to require resolution
|
426 |
| - from client data, forbid it, or allow client data while falling back to |
427 |
| - server-supplied instance data if no client data is provided. |
| 426 | + from user agent data, forbid it, or allow user agent data while falling back to |
| 427 | + server-supplied instance data if no user agent data is provided. |
428 | 428 | </t>
|
429 | 429 | <t>
|
430 | 430 | The common pattern of resolving a templated path component with
|
431 |
| - server-supplied instance data while accepting client data to build |
| 431 | + server-supplied instance data while accepting user agent data to build |
432 | 432 | a query string can be implemented by setting the "hrefSchema" subschemas
|
433 | 433 | for the path template variables to false, while giving the query string
|
434 | 434 | template variables names that do not appear in the instance. This ensures
|
435 | 435 | that the path variables can only be resolved from the instance, and the
|
436 |
| - query string variables can only be resolved from client data. |
| 436 | + query string variables can only be resolved from user agent data. |
437 | 437 | See the "hrefSchema" section for an example of this approach.
|
438 | 438 | </t>
|
439 | 439 | </section>
|
|
491 | 491 | <section title="Values for substitution">
|
492 | 492 | <t>
|
493 | 493 | The URI Template is filled out using data from some combination of an external source and the instance.
|
494 |
| - Where either instance data or external data may be used, this section will refer simply to "data" or to a "value". |
| 494 | + Where either instance data or user agent data may be used, this section will refer simply to "data" or to a "value". |
495 | 495 | When the source is important, it is specified explicitly.
|
496 | 496 |
|
497 | 497 | To allow the use of any object property (including the empty string) or array index, the following rules are defined:
|
|
507 | 507 |
|
508 | 508 | <t>
|
509 | 509 | If <xref target="hrefSchema">"hrefSchema"</xref> is present and
|
510 |
| - external input is provided, the input MUST be a valid instance according |
| 510 | + user agent data is provided, the data MUST be a valid instance according |
511 | 511 | to the value of "hrefSchema".
|
512 | 512 | Template variables, after the process listed above, MUST first
|
513 |
| - be resolved from the external data instance. Any variables left |
| 513 | + be resolved from the user agent data instance. Any variables left |
514 | 514 | unresolved MUST be resolved from the resource instance data.
|
515 | 515 | </t>
|
516 | 516 |
|
|
533 | 533 | <section title="Missing values">
|
534 | 534 | <t>
|
535 | 535 | Sometimes, the appropriate values will not be available.
|
536 |
| - For example, the template might specify the use of object properties, but no such input was provide (or "hrefSchema" is not present), and the instance is an array or a string. |
| 536 | + For example, the template might specify the use of object properties, but no such data was provided (or "hrefSchema" is not present), and the instance is an array or a string. |
537 | 537 | </t>
|
538 | 538 |
|
539 | 539 | <t>
|
540 |
| - If any of the values required for the template are present in neither the user input (if relevant) or the JSON instance, then substitute values MAY be provided from another source (such as default values). |
| 540 | + If any of the values required for the template are neither present in the user agent data (if relevant) nor the JSON instance, then substitute values MAY be provided from another source (such as default values). |
541 | 541 | Otherwise, the link definition SHOULD be considered not to apply to the instance.
|
542 | 542 | </t>
|
543 | 543 | </section>
|
|
549 | 549 | <t>
|
550 | 550 | The value of the "hrefSchema" link description property MUST be
|
551 | 551 | a valid JSON Schema. This schema is used to validate user input
|
552 |
| - or other external data for filling out the URI Template in |
| 552 | + or other user agent data for filling out the URI Template in |
553 | 553 | <xref target="href">"href"</xref>, as described in that section.
|
554 | 554 | </t>
|
555 | 555 | <t>
|
556 | 556 | Omitting "hrefSchema" or setting the entire schema to "false" prevents
|
557 |
| - any external data from being accepted. |
| 557 | + any user agent data from being accepted. |
558 | 558 | </t>
|
559 | 559 | <t>
|
560 | 560 | Implementations MUST NOT attempt to validate values resolved from
|
561 | 561 | resource instance data with "hrefSchema". This allows for different
|
562 |
| - validation rules for user input, such as supporting spelled-out |
| 562 | + validation rules for user agent data, such as supporting spelled-out |
563 | 563 | months for date-time input but using the standard date-time
|
564 | 564 | format for storage.
|
565 | 565 | </t>
|
|
593 | 593 | <figure>
|
594 | 594 | <preamble>
|
595 | 595 | In this example, the schema for "extra" is given as a reference
|
596 |
| - to keep the external data validation constraints identical to the |
| 596 | + to keep the user agent data validation constraints identical to the |
597 | 597 | instance validation constraints for the corresponding property,
|
598 |
| - while "id" is given a false schema to prevent external data for |
| 598 | + while "id" is given a false schema to prevent user agent data for |
599 | 599 | that variable.
|
600 | 600 | </preamble>
|
601 | 601 | <artwork>
|
@@ -984,7 +984,7 @@ GET /foo/
|
984 | 984 | </t>
|
985 | 985 | <t>
|
986 | 986 | Omitting "submissionSchema" or setting the entire schema to "false" prevents
|
987 |
| - any external data from being accepted. |
| 987 | + any user agent data from being accepted. |
988 | 988 | </t>
|
989 | 989 | </section>
|
990 | 990 | </section>
|
|
0 commit comments