Skip to content

Commit 2bb67af

Browse files
committed
Update spec to use member element
1 parent c5280bb commit 2bb67af

File tree

5 files changed

+264
-153
lines changed

5 files changed

+264
-153
lines changed

README.md

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Refract is a a recursive data structure for expressing complex structures, relat
1111

1212
## Version
1313

14-
**Current Version**: 0.1.0-beta
14+
**Current Version**: 0.2.0
1515

1616
**Note**: This specification is currently in development and may change before getting to a more stable 1.0 version. Please be mindful of this if using this production environments.
1717

@@ -43,22 +43,38 @@ Using Refract, we can expand this out and add some human-readable titles and des
4343
"element": "object",
4444
"content": [
4545
{
46-
"element": "string",
46+
"element": "member",
4747
"meta": {
48-
"name": "name",
4948
"title": "Name",
5049
"description": "Name of a person"
5150
},
52-
"content": "John Doe"
51+
"content": {
52+
"key": {
53+
"element": "string",
54+
"content": "name"
55+
},
56+
"value": {
57+
"element": "string",
58+
"content": "John Doe"
59+
}
60+
}
5361
},
5462
{
55-
"element": "string",
63+
"element": "member",
5664
"meta": {
57-
"name": "email",
5865
"title": "Email",
5966
"description": "Email address for the person"
6067
},
61-
"content": "[email protected]"
68+
"content": {
69+
"key": {
70+
"element": "string",
71+
"content": "email"
72+
},
73+
"value": {
74+
"element": "string",
75+
"content": "[email protected]"
76+
}
77+
}
6278
}
6379
]
6480
}
@@ -103,22 +119,38 @@ Refract can actually go a step further with our previous example and annotate at
103119
"element": "person",
104120
"attributes": [
105121
{
106-
"element": "string",
122+
"element": "member",
107123
"meta": {
108-
"name": "name",
109124
"title": "Name",
110125
"description": "Name of a person"
111126
},
112-
"content": "John Doe"
127+
"content": {
128+
"key": {
129+
"element": "string",
130+
"content": "name"
131+
},
132+
"value": {
133+
"element": "string",
134+
"content": "John Doe"
135+
}
136+
}
113137
},
114138
{
115-
"element": "string",
139+
"element": "member",
116140
"meta": {
117-
"name": "email",
118141
"title": "Email",
119142
"description": "Email address for the person"
120143
},
121-
"content": "[email protected]"
144+
"content": {
145+
"key": {
146+
"element": "string",
147+
"content": "email"
148+
},
149+
"value": {
150+
"element": "string",
151+
"content": "[email protected]"
152+
}
153+
}
122154
}
123155
]
124156
}

namespaces/api-namespace.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ This document extends [Refract][] [Resource Namespace][] to define REST API data
66

77
<!-- TOC depth:2 withLinks:1 updateOnSave:1 -->
88
- [API Namespace](#api-namespace)
9-
- [Content](#content)
10-
- [About this Document](#about-this-document)
11-
- [Category (Element)](#category-element)
12-
- [Copy (Element)](#copy-element)
9+
- [Content](#content)
10+
- [About this Document](#about-this-document)
11+
- [Category (Element)](#category-element)
12+
- [Copy (Element)](#copy-element)
1313
<!-- /TOC -->
1414

1515
## About this Document

0 commit comments

Comments
 (0)