Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: tools/json_schema_compiler/test/enums.json

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Tested GetAllPossibleParameterLists better. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 [ 1 [
2 { 2 {
3 "namespace": "enums", 3 "namespace": "enums",
4 "types": [ 4 "types": [
5 { 5 {
6 "id": "EnumType", 6 "id": "EnumType",
7 "type": "object", 7 "type": "object",
8 "properties": { 8 "properties": {
9 "type": { 9 "type": {
10 "type": "string", 10 "type": "string",
(...skipping 25 matching lines...) Expand all
36 "enum": ["foo", "bar", "baz"] 36 "enum": ["foo", "bar", "baz"]
37 }, 37 },
38 { 38 {
39 "name": "callback", 39 "name": "callback",
40 "type": "function", 40 "type": "function",
41 "parameters": [] 41 "parameters": []
42 } 42 }
43 ] 43 ]
44 }, 44 },
45 { 45 {
46 "name": "returnsEnum",
47 "type": "function",
48 "description": "Returns an enum through the callback",
49 "parameters": [
50 {
51 "name": "callback",
52 "type": "function",
53 "parameters": [
54 {
55 "name": "state",
56 "type": "string",
57 "enum": ["foo", "bar", "baz"]
58 }
59 ]
60 }
61 ]
62 },
63 {
64 "name": "returnsTwoEnums",
65 "type": "function",
66 "description": "Returns two enums through the callback",
67 "parameters": [
68 {
69 "name": "callback",
70 "type": "function",
71 "parameters": [
72 {
73 "name": "firstState",
74 "type": "string",
75 "enum": ["foo", "bar", "baz"]
76 },
77 {
78 "name": "secondState",
79 "type": "string",
80 "enum": ["spam", "ham", "eggs"]
81 }
82 ]
83 }
84 ]
85 },
86 {
46 "name": "takesOptionalEnum", 87 "name": "takesOptionalEnum",
47 "type": "function", 88 "type": "function",
48 "description": "Takes an enum as its parameter.", 89 "description": "Takes an enum as its parameter.",
49 "parameters": [ 90 "parameters": [
50 { 91 {
51 "name": "state", 92 "name": "state",
52 "type": "string", 93 "type": "string",
53 "enum": ["foo", "bar", "baz"], 94 "enum": ["foo", "bar", "baz"],
54 "optional": true 95 "optional": true
55 }, 96 },
(...skipping 21 matching lines...) Expand all
77 "enum": ["foo", "ding", "dong"], 118 "enum": ["foo", "ding", "dong"],
78 "optional": true 119 "optional": true
79 }, 120 },
80 { 121 {
81 "name": "callback", 122 "name": "callback",
82 "type": "function", 123 "type": "function",
83 "parameters": [] 124 "parameters": []
84 } 125 }
85 ] 126 ]
86 } 127 }
128 ],
129 "events": [
130 {
131 "name": "onEnumFired",
132 "type": "function",
133 "description": "Fired when an enum is ready.",
134 "parameters": [
135 {
136 "name": "someEnum",
137 "type": "string",
138 "enum": ["foo", "bar", "baz"]
139 }
140 ]
141 },
142 {
143 "name": "onTwoEnumsFired",
144 "type": "function",
145 "description": "Fired when two enums are ready.",
146 "parameters": [
147 {
148 "name": "firstEnum",
149 "type": "string",
150 "enum": ["foo", "bar", "baz"]
151 },
152 {
153 "name": "secondEnum",
154 "type": "string",
155 "enum": ["spam", "ham", "eggs"]
156 }
157 ]
158 }
87 ] 159 ]
88 } 160 }
89 ] 161 ]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698