Revert of Use ExtensionRegistryObserver instead of deprecated extension notification...
[chromium-blink-merge.git] / tools / json_schema_compiler / test / simple_api.json
blob9ab54037be875055f36beb591f9a533f3a3467fb
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     "functions": [
30       {
31         "name": "incrementInteger",
32         "type": "function",
33         "description": "Increments the given integer.",
34         "parameters": [
35           {
36             "name": "num",
37             "type": "integer"
38           },
39           {
40             "name": "callback",
41             "type": "function",
42             "parameters": [
43               {
44                 "name": "result",
45                 "type": "integer",
46                 "description": "The incremented value."
47               }
48             ]
49           }
50         ]
51       },
52       {
53         "name": "optionalString",
54         "type": "function",
55         "description": "Takes a string. Or not.",
56         "parameters": [
57           {
58             "name": "str",
59             "type": "string",
60             "optional": true
61           },
62           {
63             "name": "callback",
64             "type": "function",
65             "parameters": []
66           }
67         ]
68       },
69       {
70         "name": "optionalBeforeRequired",
71         "type": "function",
72         "description": "Takes an optional parameter followed by a required one.",
73         "parameters": [
74           {
75             "name": "first",
76             "type": "string",
77             "optional": true
78           },
79           {
80             "name": "second",
81             "type": "string"
82           },
83           {
84             "name": "callback",
85             "type": "function",
86             "parameters": []
87           }
88         ]
89       },
90       {
91         "name": "optionalCallbackParams",
92         "type": "function",
93         "description": "Gives back a string. Or not.",
94         "parameters": [
95           {
96             "name": "callback",
97             "type": "function",
98             "parameters": [
99               {
100                 "name": "result",
101                 "$ref": "TestType",
102                 "description": "True if the extension has the specified permissions."
103               }
104             ]
105           }
106         ]
107       },
108       {
109         "name": "getTestType",
110         "type": "function",
111         "description": "Return a TestType.",
112         "parameters": [
113           {
114             "name": "callback",
115             "type": "function",
116             "parameters": [
117               {
118                 "name": "result",
119                 "$ref": "TestType",
120                 "description": "A TestType."
121               }
122             ]
123           }
124         ]
125       }
126     ],
127     "events": [
128       {
129         "name": "onIntegerFired",
130         "type": "function",
131         "description": "Fired when an integer is ready.",
132         "parameters": [
133           {
134             "name": "someInteger",
135             "type": "integer"
136           }
137         ]
138       },
139       {
140         "name": "onStringFired",
141         "type": "function",
142         "description": "Fired when a string is ready.",
143         "parameters": [
144           {
145             "name": "someString",
146             "type": "string"
147           }
148         ]
149       },
150       {
151         "name": "onTestTypeFired",
152         "type": "function",
153         "description": "Fired when a TestType is ready.",
154         "parameters": [
155           {
156             "name": "someTestType",
157             "$ref": "TestType"
158           }
159         ]
160       }
161     ]
162   }