Roll src/third_party/WebKit f007c95:0171005 (svn 185074:185088)
[chromium-blink-merge.git] / tools / json_schema_compiler / test / arrays.json
blob23314e92f872779fcdd08daa85f026156f10c214
2   {
3     "namespace": "arrays",
4     "description": "The arrays API.",
5     "types": [
6       {
7         "id": "EnumArrayType",
8         "type": "object",
9         "properties": {
10           "types": {
11             "type": "array",
12             "items": {
13               "type": "string",
14               "enum": ["one", "two", "three"]
15             }
16           }
17         }
18       },
19       {
20         "id": "Enumeration",
21         "type": "string",
22         "enum": ["one", "two", "three"]
23       },
24       {
25         "id": "EnumArrayReference",
26         "type": "object",
27         "properties": {
28           "types": {
29             "type": "array",
30             "items": {
31               "$ref": "Enumeration"
32             }
33           }
34         }
35       },
36       {
37         "id": "EnumArrayMixed",
38         "type": "object",
39         "properties": {
40           "inline_enums": {
41             "type": "array",
42             "items": {
43               "type": "string",
44               "enum": ["one", "two", "three"]
45             }
46           },
47           "infile_enums": {
48             "type": "array",
49             "items": {
50               "$ref": "Enumeration"
51             }
52           },
53           "external_enums": {
54             "type": "array",
55             "items": {
56               "$ref": "enums.Enumeration"
57             }
58           }
59         }
60       },
61       {
62         "id": "OptionalEnumArrayType",
63         "type": "object",
64         "properties": {
65           "types": {
66             "type": "array",
67             "items": {
68               "type": "string",
69               "enum": ["one", "two", "three"]
70             },
71             "optional": true
72           }
73         }
74       },
75       {
76         "id": "BasicArrayType",
77         "type": "object",
78         "properties": {
79           "strings": {
80             "type": "array",
81             "items": {"type": "string"}
82           },
83           "booleans": {
84             "type": "array",
85             "items": {"type": "boolean"}
86           },
87           "numbers": {
88             "type": "array",
89             "items": {"type": "number"}
90           },
91           "integers": {
92             "type": "array",
93             "items": {"type": "integer"}
94           }
95         }
96       },
97       {
98         "id": "Item",
99         "type": "object",
100         "properties": {
101           "val": {
102             "type": "integer"
103           }
104         }
105       },
106       {
107         "id": "RefArrayType",
108         "type": "object",
109         "properties": {
110           "refs": {
111             "type": "array",
112             "items": { "$ref": "Item" }
113           }
114         }
115       }
116     ],
117     "functions": [
118       {
119         "name": "integerArray",
120         "type": "function",
121         "description": "Takes some integers.",
122         "parameters": [
123           {
124             "name": "nums",
125             "type": "array",
126             "items": {"type": "integer"}
127           },
128           {
129             "name": "callback",
130             "type": "function",
131             "parameters": []
132           }
133         ]
134       },
135       {
136         "name": "anyArray",
137         "type": "function",
138         "description": "Takes some Items.",
139         "parameters": [
140           {
141             "name": "anys",
142             "type": "array",
143             "items": {"type": "any"}
144           },
145           {
146             "name": "callback",
147             "type": "function",
148             "parameters": []
149           }
150         ]
151       },
152       {
153         "name": "objectArray",
154         "type": "function",
155         "description": "Takes some Items.",
156         "parameters": [
157           {
158             "name": "objects",
159             "type": "array",
160             "items": {
161               "type": "object",
162               "additionalProperties": {"type": "integer"}
163             }
164           },
165           {
166             "name": "callback",
167             "type": "function",
168             "parameters": []
169           }
170         ]
171       },
172       {
173         "name": "refArray",
174         "type": "function",
175         "description": "Takes some Items.",
176         "parameters": [
177           {
178             "name": "refs",
179             "type": "array",
180             "items": {"$ref": "Item"}
181           },
182           {
183             "name": "callback",
184             "type": "function",
185             "parameters": []
186           }
187         ]
188       },
189       {
190         "name": "justChoices",
191         "type": "function",
192         "description": "Takes some Choices.",
193         "parameters": [
194           {
195             "name": "choices",
196             "choices": [
197               { "type": "integer" },
198               { "type": "boolean" },
199               { "type": "array",
200                 "items": {"$ref": "Item"}
201               }
202             ]
203           },
204           {
205             "name": "callback",
206             "type": "function",
207             "parameters": []
208           }
209         ]
210       },
211       {
212         "name": "choicesArray",
213         "type": "function",
214         "description": "Takes some Choices.",
215         "parameters": [
216           {
217             "name": "choices",
218             "type": "array",
219             "items": {
220               "choices": [
221                 { "type": "integer" },
222                 { "type": "boolean" },
223                 { "type": "array",
224                   "items": {"$ref": "Item"}
225                 }
226               ]
227             }
228           },
229           {
230             "name": "callback",
231             "type": "function",
232             "parameters": []
233           }
234         ]
235       },
236       {
237         "name": "returnIntegerArray",
238         "type": "function",
239         "description": "Returns some integers.",
240         "parameters": [
241           {
242             "name": "callback",
243             "type": "function",
244             "parameters": [
245               {
246                 "name": "integers",
247                 "type": "array",
248                 "items": {"type": "integer"}
249               }
250             ]
251           }
252         ]
253       },
254       {
255         "name": "returnRefArray",
256         "type": "function",
257         "description": "Returns some Items.",
258         "parameters": [
259           {
260             "name": "callback",
261             "type": "function",
262             "parameters": [
263               {
264                 "name": "refs",
265                 "type": "array",
266                 "items": {"$ref": "Item"}
267               }
268             ]
269           }
270         ]
271       }
272     ]
273   }