You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -46,15 +48,15 @@ MSON is built around the idea of defining recursive data structures. To provide
46
48
47
49
By default, Refract does not enforce inheritance of data, though element defintions are inherited from the defined element types. To inherit data in Refract, the `extend` element is used to merge one or more elements into a final element. In the MSON namespace, however, when the data is defined, it inherits data from the element definition. MSON itself uses inheritance this way, and the MSON Refract namespace mimics the behavior to provide simplicity and consistency across MSON representations.
48
50
49
-
Often, before an MSON DOM can be processed, referenced _Named Types_ have to be resolved. Resolving references to _Named Types_ is tedious and error prone. As such an MSON processor can resolve references to produce a complete MSON DOM. That is, a DOM that does not include unresolved references to other data structures. This is referred to as _reference expansion_ or simply _expansion_.
51
+
Often, before an MSON Refract can be processed, referenced _Named Types_ have to be resolved. Resolving references to _Named Types_ is tedious and error prone. As such an MSON processor can resolve references to produce a complete MSON Refract. That is, a Refract that does not include unresolved references to other data structures. This is referred to as _reference expansion_ or simply _expansion_.
50
52
51
53
In other words, an expanded element is one that does not contain any _Identifier_ (defined below) referencing any other elements than those defined in MSON namespaces.
52
54
53
-
The expanded DOM MUST, however, keep the track of what data structure was expanded and what from where.
55
+
The expanded Refract MUST, however, keep the track of what data structure was expanded and what from where.
54
56
55
57
## Base Element
56
58
57
-
In MSON, every data structure is a sub-type of another data structure, and, therefore, it is directly or indirectly derived from one of the MSON _Base Types_. This is expressed as an inheritance of elements in MSON DOM. Where the predecessor of an element is referred to as element's _Base Element_.
59
+
In MSON, every data structure is a sub-type of another data structure, and, therefore, it is directly or indirectly derived from one of the MSON _Base Types_. This is expressed as an inheritance of elements in MSON Refract. Where the predecessor of an element is referred to as element's _Base Element_.
58
60
59
61
Note: Not every MSON _Base Type_ is presented in Refract primitive types and vice versa – see the table below.
60
62
@@ -70,15 +72,15 @@ Note: Not every MSON _Base Type_ is presented in Refract primitive types and vic
70
72
| object | Object Element | object | Object Type |
71
73
| null | Null Element | - | - |
72
74
73
-
# MSON DOM Elements
75
+
# MSON Refract Elements
74
76
75
-
## MSON Element (Element[*T*])
77
+
## MSON Element (Element)
76
78
77
79
Base element for every MSON element.
78
80
79
81
The MSON Element adds attributes representing MSON _Type Definition_ and _Type Sections_.
80
82
81
-
Note: In MSON DOM_Nested Member Types__Type Section_ is the `content` of the element.
83
+
Note: In MSON Refract_Nested Member Types__Type Section_ is the `content` of the element.
82
84
83
85
### Properties
84
86
@@ -91,21 +93,23 @@ Note: In MSON DOM _Nested Member Types_ _Type Section_ is the `content` of the e
91
93
- sample - The `content` value is a sample value.
92
94
- default - The `content` value is a default value.
93
95
94
-
-`variable` (boolean) - The `content` value is a _Variable Value_
96
+
-`variable` (boolean)
97
+
98
+
The `content` value is either a _Variable Type Name_, or _Variable Property Name_.
95
99
96
-
The `content` value is either a _Variable Type Name_, _Variable Value_ or _Variable Property Name_.
100
+
Note, if the `content` is a _Variable Value_ the `sample` type attribute
101
+
should be used instead (see `typeAttributes`).
97
102
98
-
-`sample` (array[T]) - Alternative sample value for _Member Types_
103
+
-`sample` (array) - Alternative sample value for _Member Types_
99
104
100
105
The type of items in `sample` array attribute MUST match the type of element's `content`.
101
106
102
-
- `default` (T) - Default value for _Member Types_
107
+
- `default` - Default value for _Member Types_
103
108
104
109
The type of of `default` attribute MUST match the type of element's `content`.
105
110
106
111
- `validation` - Not used, reserved for a future use
107
112
108
-
-`content` (T)
109
113
110
114
## Boolean Type (Boolean Element)
111
115
@@ -146,7 +150,7 @@ Enumeration type. Exclusive list of possible elements. The elements in content's
146
150
- green
147
151
```
148
152
149
-
#### MSON DOM
153
+
#### MSON Refract
150
154
151
155
```json
152
156
{
@@ -182,7 +186,7 @@ Enumeration type. Exclusive list of possible elements. The elements in content's
182
186
- id: 42
183
187
```
184
188
185
-
#### MSON DOM
189
+
#### MSON Refract
186
190
187
191
```json
188
192
{
@@ -207,7 +211,7 @@ Enumeration type. Exclusive list of possible elements. The elements in content's
207
211
- id: 42 (required, fixed)
208
212
```
209
213
210
-
#### MSON DOM
214
+
#### MSON Refract
211
215
212
216
```json
213
217
{
@@ -239,7 +243,7 @@ Enumeration type. Exclusive list of possible elements. The elements in content's
239
243
- default: 0
240
244
```
241
245
242
-
#### MSON DOM
246
+
#### MSON Refract
243
247
244
248
```json
245
249
{
@@ -270,7 +274,7 @@ Enumeration type. Exclusive list of possible elements. The elements in content's
270
274
- province
271
275
```
272
276
273
-
#### MSON DOM
277
+
#### MSON Refract
274
278
275
279
```json
276
280
{
@@ -322,7 +326,7 @@ Enumeration type. Exclusive list of possible elements. The elements in content's
322
326
- Include User
323
327
```
324
328
325
-
#### MSON DOM
329
+
#### MSON Refract
326
330
327
331
Using the `ref` element to reference an the content of an element.
328
332
@@ -386,7 +390,7 @@ Description is here! Properties to follow.
386
390
- street
387
391
```
388
392
389
-
#### MSON DOM
393
+
#### MSON Refract
390
394
391
395
```json
392
396
{
@@ -409,6 +413,8 @@ Description is here! Properties to follow.
409
413
410
414
### Referencing & Expansion
411
415
416
+
#### MSON
417
+
412
418
```markdown
413
419
# User (object)
414
420
- name
@@ -417,6 +423,8 @@ Description is here! Properties to follow.
417
423
- id
418
424
```
419
425
426
+
#### MSON Refract
427
+
420
428
```json
421
429
{
422
430
"element": "object",
@@ -451,7 +459,7 @@ Description is here! Properties to follow.
451
459
}
452
460
```
453
461
454
-
#### Expanded
462
+
#### Expanded MSON Refract
455
463
456
464
```json
457
465
{
@@ -489,6 +497,63 @@ Description is here! Properties to follow.
0 commit comments