Skip to content

Commit 1282e6d

Browse files
stasmeemeliaphillips
authored
Make arrays in the data model not optional (#633)
* Make arrays in the data model not optional * Add note about purpose & relaxations in JSON Schema & DTD definitions * Update spec/data-model/README.md Co-authored-by: Addison Phillips <[email protected]> --------- Co-authored-by: Eemeli Aro <[email protected]> Co-authored-by: Eemeli Aro <[email protected]> Co-authored-by: Addison Phillips <[email protected]>
1 parent 28b7bf6 commit 1282e6d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

spec/data-model/README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ Two equivalent definitions of the data model are also provided:
4141
- [`message.dtd`](./message.dtd) is a document type definition (DTD),
4242
for use with message data encoded as XML.
4343

44+
Note that while the data model description below is the canonical one,
45+
the JSON and DTD definitions are intended for interchange between systems and processors.
46+
To that end, they relax some aspects of the data model, such as allowing
47+
declarations, options, and attributes to be optional rather than required properties.
48+
4449
## Messages
4550

4651
A `SelectMessage` corresponds to a syntax message that includes _selectors_.
@@ -157,28 +162,28 @@ interface LiteralExpression {
157162
type: "expression";
158163
arg: Literal;
159164
annotation?: FunctionAnnotation | UnsupportedAnnotation;
160-
attributes?: Attribute[];
165+
attributes: Attribute[];
161166
}
162167

163168
interface VariableExpression {
164169
type: "expression";
165170
arg: VariableRef;
166171
annotation?: FunctionAnnotation | UnsupportedAnnotation;
167-
attributes?: Attribute[];
172+
attributes: Attribute[];
168173
}
169174

170175
interface FunctionExpression {
171176
type: "expression";
172177
arg?: never;
173178
annotation: FunctionAnnotation;
174-
attributes?: Attribute[];
179+
attributes: Attribute[];
175180
}
176181

177182
interface UnsupportedExpression {
178183
type: "expression";
179184
arg?: never;
180185
annotation: UnsupportedAnnotation;
181-
attributes?: Attribute[];
186+
attributes: Attribute[];
182187
}
183188

184189
interface Attribute {
@@ -220,7 +225,7 @@ Each _option_ is represented by an `Option`.
220225
interface FunctionAnnotation {
221226
type: "function";
222227
name: string;
223-
options?: Option[];
228+
options: Option[];
224229
}
225230

226231
interface Option {
@@ -268,8 +273,8 @@ interface Markup {
268273
type: "markup";
269274
kind: "open" | "standalone" | "close";
270275
name: string;
271-
options?: Option[];
272-
attributes?: Attribute[];
276+
options: Option[];
277+
attributes: Attribute[];
273278
}
274279
```
275280

0 commit comments

Comments
 (0)