@@ -139,9 +139,9 @@ This schema constrains a JSON node to be of type `string`:
139139~~~
140140
141141In the case of a schema that references a compound type (`object`, `set`,
142- ` array` , `map`, `tuple`), the schema further describes the structure of the
143- compound type. Schemas can be placed into a namespace ({{namespaces}}) for
144- reuse in other schemas.
142+ ` array` , `map`, `tuple`, `choice` ), the schema further describes the structure
143+ of the compound type. Schemas can be placed into a namespace ({{namespaces}})
144+ for reuse in other schemas.
145145
146146~~~ json
147147{
@@ -611,9 +611,16 @@ The `tuple` type is used to define an ordered collection of elements with a
611611specific length. It's represented as a JSON array where each element is of a
612612specific type.
613613
614- The elements are defined using a `properties` map as with the
615- ` object` ({{object}}) type and each element is named. All declared properties of
616- a `tuple` are implicitly required.
614+ The elements are defined using a `properties` map as with the `object`
615+ ({{object}}) type and each element is named. This permits straightforward
616+ mapping into application constructs. All declared properties of a `tuple` are
617+ implicitly REQUIRED.
618+
619+ The order of the elements in a tuple is declared using the `tuple` keyword
620+ {{tuple-keyword}}, which is REQUIRED. The `tuple` keyword MUST be a JSON array
621+ of strings, where each declared property name MUST be an element of the array.
622+ The order of the elements in the array defines the order of the properties in
623+ the tuple.
617624
618625A `tuple` type MUST include a `name` attribute that defines the name of the
619626type.
@@ -627,7 +634,8 @@ Example:
627634 " properties " : {
628635 " name " : { "type": "string" },
629636 " age " : { "type": "int32" }
630- }
637+ },
638+ " tuple " : ["name", "age"]
631639}
632640~~~
633641
@@ -1371,6 +1379,17 @@ The `selector` keyword MUST only be used in schemas of type `choice` ({{choice}}
13711379
13721380See `choice` ({{choice}}) for an example.
13731381
1382+ # ## The `tuple` Keyword {#tuple-keyword}
1383+
1384+ The `tuple` keyword defines the order of properties in a `tuple` type. The
1385+ value of `tuple` MUST be an array of strings, where each string is the name of a
1386+ property defined in the `properties` map. The order of the strings in the array
1387+ defines the order of the properties in the tuple.
1388+
1389+ The `tuple` keyword MUST only be used in schemas of type `tuple` ({{tuple}}).
1390+
1391+ See `tuple` ({{tuple}}) for an example.
1392+
13741393# # Type Annotation Keywords {#type-annotation-keywords}
13751394
13761395Type annotation keywords provide additional metadata about the underlying type.
0 commit comments