Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / json_schema_compiler / test / objects.json
blobdd0bb2072049303f8a8a61ccb64816f72527f02b
2   {
3     "namespace": "objects",
4     "description": "The objects API.",
5     "types": [
6       {
7         "id": "firstState",
8         "type": "string",
9         "enum": ["foo", "bar", "baz"]
10       },
11       {
12         "id": "secondState",
13         "type": "string",
14         "enum": ["spam", "ham", "eggs"]
15       }
16     ],
17     "functions": [
18       {
19         "name": "objectParam",
20         "type": "function",
21         "description": "Takes an object.",
22         "parameters": [
23           {
24             "name": "info",
25             "type": "object",
26             "properties": {
27               "strings": {
28                 "type": "array",
29                 "items": {"type": "string"}
30               },
31               "integer": {
32                 "type": "integer"
33               },
34               "boolean": {
35                 "type": "boolean"
36               }
37             }
38           },
39           {
40             "name": "callback",
41             "type": "function",
42             "parameters": []
43           }
44         ]
45       },
46       {
47         "name": "returnsObject",
48         "description": "Returns an object.",
49         "type": "function",
50         "parameters": [
51           {
52             "name": "callback",
53             "type": "function",
54             "parameters": [
55               {
56                 "name": "info",
57                 "type": "object",
58                 "properties": {
59                   "state": {
60                     "$ref": "firstState"
61                   }
62                 }
63               }
64             ]
65           }
66         ]
67       },
68       {
69         "name": "returnsTwoObjects",
70         "description": "Return two objects.",
71         "type": "function",
72         "parameters": [
73           {
74             "name": "callback",
75             "type": "function",
76             "parameters": [
77               {
78                 "name": "firstInfo",
79                 "type": "object",
80                 "properties": {
81                   "state": {
82                     "$ref": "firstState"
83                   }
84                 }
85               },
86               {
87                 "name": "secondInfo",
88                 "type": "object",
89                 "properties": {
90                   "state": {
91                     "$ref": "secondState"
92                   }
93                 }
94               }
95             ]
96           }
97         ]
98       }
99     ],
100     "events": [
101       {
102         "name": "onObjectFired",
103         "type": "function",
104         "description": "Fired when an object is ready.",
105         "parameters": [
106           {
107             "name": "someObject",
108             "type": "object",
109             "properties": {
110               "state": {
111                 "$ref": "firstState"
112               }
113             }
114           }
115         ]
116       },
117       {
118         "name": "onTwoObjectsFired",
119         "type": "function",
120         "description": "Fired when two objects are ready.",
121         "parameters": [
122           {
123             "name": "firstObject",
124             "type": "object",
125             "properties": {
126               "state": {
127                 "$ref": "firstState"
128               }
129             }
130           },
131           {
132             "name": "secondObject",
133             "type": "object",
134             "properties": {
135               "state": {
136                 "$ref": "secondState"
137               }
138             }
139           }
140         ]
141       }
142     ]
143   }