- add sources.
[platform/framework/web/crosswalk.git] / src / tools / json_schema_compiler / test / arrays.json
1 [
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": "OptionalEnumArrayType",
21         "type": "object",
22         "properties": {
23           "types": {
24             "type": "array",
25             "items": {
26               "type": "string",
27               "enum": ["one", "two", "three"]
28             },
29             "optional": true
30           }
31         }
32       },
33       {
34         "id": "BasicArrayType",
35         "type": "object",
36         "properties": {
37           "strings": {
38             "type": "array",
39             "items": {"type": "string"}
40           },
41           "booleans": {
42             "type": "array",
43             "items": {"type": "boolean"}
44           },
45           "numbers": {
46             "type": "array",
47             "items": {"type": "number"}
48           },
49           "integers": {
50             "type": "array",
51             "items": {"type": "integer"}
52           }
53         }
54       },
55       {
56         "id": "Item",
57         "type": "object",
58         "properties": {
59           "val": {
60             "type": "integer"
61           }
62         }
63       },
64       {
65         "id": "RefArrayType",
66         "type": "object",
67         "properties": {
68           "refs": {
69             "type": "array",
70             "items": { "$ref": "Item" }
71           }
72         }
73       }
74     ],
75     "functions": [
76       {
77         "name": "integerArray",
78         "type": "function",
79         "description": "Takes some integers.",
80         "parameters": [
81           {
82             "name": "nums",
83             "type": "array",
84             "items": {"type": "integer"}
85           },
86           {
87             "name": "callback",
88             "type": "function",
89             "parameters": []
90           }
91         ]
92       },
93       {
94         "name": "anyArray",
95         "type": "function",
96         "description": "Takes some Items.",
97         "parameters": [
98           {
99             "name": "anys",
100             "type": "array",
101             "items": {"type": "any"}
102           },
103           {
104             "name": "callback",
105             "type": "function",
106             "parameters": []
107           }
108         ]
109       },
110       {
111         "name": "objectArray",
112         "type": "function",
113         "description": "Takes some Items.",
114         "parameters": [
115           {
116             "name": "objects",
117             "type": "array",
118             "items": {
119               "type": "object",
120               "additionalProperties": {"type": "integer"}
121             }
122           },
123           {
124             "name": "callback",
125             "type": "function",
126             "parameters": []
127           }
128         ]
129       },
130       {
131         "name": "refArray",
132         "type": "function",
133         "description": "Takes some Items.",
134         "parameters": [
135           {
136             "name": "refs",
137             "type": "array",
138             "items": {"$ref": "Item"}
139           },
140           {
141             "name": "callback",
142             "type": "function",
143             "parameters": []
144           }
145         ]
146       },
147       {
148         "name": "justChoices",
149         "type": "function",
150         "description": "Takes some Choices.",
151         "parameters": [
152           {
153             "name": "choices",
154             "choices": [
155               { "type": "integer" },
156               { "type": "boolean" },
157               { "type": "array",
158                 "items": {"$ref": "Item"}
159               }
160             ]
161           },
162           {
163             "name": "callback",
164             "type": "function",
165             "parameters": []
166           }
167         ]
168       },
169       {
170         "name": "choicesArray",
171         "type": "function",
172         "description": "Takes some Choices.",
173         "parameters": [
174           {
175             "name": "choices",
176             "type": "array",
177             "items": {
178               "choices": [
179                 { "type": "integer" },
180                 { "type": "boolean" },
181                 { "type": "array",
182                   "items": {"$ref": "Item"}
183                 }
184               ]
185             }
186           },
187           {
188             "name": "callback",
189             "type": "function",
190             "parameters": []
191           }
192         ]
193       },
194       {
195         "name": "returnIntegerArray",
196         "type": "function",
197         "description": "Returns some integers.",
198         "parameters": [
199           {
200             "name": "callback",
201             "type": "function",
202             "parameters": [
203               {
204                 "name": "integers",
205                 "type": "array",
206                 "items": {"type": "integer"}
207               }
208             ]
209           }
210         ]
211       },
212       {
213         "name": "returnRefArray",
214         "type": "function",
215         "description": "Returns some Items.",
216         "parameters": [
217           {
218             "name": "callback",
219             "type": "function",
220             "parameters": [
221               {
222                 "name": "refs",
223                 "type": "array",
224                 "items": {"$ref": "Item"}
225               }
226             ]
227           }
228         ]
229       }
230     ]
231   }
232 ]