Added gcdPrivate.getDeviceInfo function
[chromium-blink-merge.git] / tools / json_schema_compiler / test / simple_api.json
blob78311874b88121bd053db7f07a30ad38e0a7fec1
2   {
3     "namespace": "simple_api",
4     "description": "This is a simple API.",
5     "types": [
6       {
7         "id": "TestType",
8         "type": "object",
9         "properties": {
10           "string": {
11             "type": "string",
12             "description": "Some string."
13           },
14           "boolean": {
15             "type": "boolean",
16             "description": "Some boolean."
17           },
18           "number": {
19             "type": "number",
20             "description": "Some double."
21           },
22           "integer": {
23             "type": "integer",
24             "description": "Some integer."
25           }
26         }
27       },
28       {
29         "id": "TestEnum",
30         "type": "string",
31         "enum": ["one", "two", "three"]
32       }
33     ],
34     "functions": [
35       {
36         "name": "incrementInteger",
37         "type": "function",
38         "description": "Increments the given integer.",
39         "parameters": [
40           {
41             "name": "num",
42             "type": "integer"
43           },
44           {
45             "name": "callback",
46             "type": "function",
47             "parameters": [
48               {
49                 "name": "result",
50                 "type": "integer",
51                 "description": "The incremented value."
52               }
53             ]
54           }
55         ]
56       },
57       {
58         "name": "optionalString",
59         "type": "function",
60         "description": "Takes a string. Or not.",
61         "parameters": [
62           {
63             "name": "str",
64             "type": "string",
65             "optional": true
66           },
67           {
68             "name": "callback",
69             "type": "function",
70             "parameters": []
71           }
72         ]
73       },
74       {
75         "name": "optionalBeforeRequired",
76         "type": "function",
77         "description": "Takes an optional parameter followed by a required one.",
78         "parameters": [
79           {
80             "name": "first",
81             "type": "string",
82             "optional": true
83           },
84           {
85             "name": "second",
86             "type": "string"
87           },
88           {
89             "name": "callback",
90             "type": "function",
91             "parameters": []
92           }
93         ]
94       },
95       {
96         "name": "optionalCallbackParams",
97         "type": "function",
98         "description": "Gives back a string. Or not.",
99         "parameters": [
100           {
101             "name": "callback",
102             "type": "function",
103             "parameters": [
104               {
105                 "name": "result",
106                 "$ref": "TestType",
107                 "description": "True if the extension has the specified permissions."
108               }
109             ]
110           }
111         ]
112       },
113       {
114         "name": "getTestType",
115         "type": "function",
116         "description": "Return a TestType.",
117         "parameters": [
118           {
119             "name": "callback",
120             "type": "function",
121             "parameters": [
122               {
123                 "name": "result",
124                 "$ref": "TestType",
125                 "description": "A TestType."
126               }
127             ]
128           }
129         ]
130       }
131     ],
132     "events": [
133       {
134         "name": "onIntegerFired",
135         "type": "function",
136         "description": "Fired when an integer is ready.",
137         "parameters": [
138           {
139             "name": "someInteger",
140             "type": "integer"
141           }
142         ]
143       },
144       {
145         "name": "onStringFired",
146         "type": "function",
147         "description": "Fired when a string is ready.",
148         "parameters": [
149           {
150             "name": "someString",
151             "type": "string"
152           }
153         ]
154       },
155       {
156         "name": "onTestTypeFired",
157         "type": "function",
158         "description": "Fired when a TestType is ready.",
159         "parameters": [
160           {
161             "name": "someTestType",
162             "$ref": "TestType"
163           }
164         ]
165       }
166     ]
167   }