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

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

Issue 10828407: JSON Schema Compiler supports Enums as types. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added a todo comment Created 8 years, 3 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
« no previous file with comments | « tools/json_schema_compiler/model.py ('k') | tools/json_schema_compiler/test/enums_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 [ 1 [
2 { 2 {
3 "namespace": "enums", 3 "namespace": "enums",
4 "types": [ 4 "types": [
5 { 5 {
6 "id": "Enumeration",
7 "enum": ["none", "one", "two", "three"]
8 },
9 {
6 "id": "EnumType", 10 "id": "EnumType",
7 "type": "object", 11 "type": "object",
8 "properties": { 12 "properties": {
9 "type": { 13 "type": {
10 "type": "string", 14 "type": "string",
11 "enum": ["one", "two", "three"] 15 "enum": ["one", "two", "three"]
12 } 16 }
13 } 17 }
14 }, 18 },
15 { 19 {
20 "id": "HasEnumeration",
21 "type": "object",
22 "properties": {
23 "enumeration": {
24 "$ref": "Enumeration"
25 },
26 "optional_enumeration": {
27 "$ref": "Enumeration",
28 "optional": true
29 }
30 }
31 },
32 {
16 "id": "OptionalEnumType", 33 "id": "OptionalEnumType",
17 "type": "object", 34 "type": "object",
18 "properties": { 35 "properties": {
19 "type": { 36 "type": {
20 "type": "string", 37 "type": "string",
21 "enum": ["one", "two", "three"], 38 "enum": ["one", "two", "three"],
22 "optional": true 39 "optional": true
23 } 40 }
24 } 41 }
25 } 42 }
(...skipping 10 matching lines...) Expand all
36 "enum": ["foo", "bar", "baz"] 53 "enum": ["foo", "bar", "baz"]
37 }, 54 },
38 { 55 {
39 "name": "callback", 56 "name": "callback",
40 "type": "function", 57 "type": "function",
41 "parameters": [] 58 "parameters": []
42 } 59 }
43 ] 60 ]
44 }, 61 },
45 { 62 {
63 "name": "takesEnumAsType",
64 "type": "function",
65 "description": "Takes an enum type as its parameter.",
66 "parameters": [
67 {
68 "name": "enumeration",
69 "$ref": "Enumeration"
70 },
71 {
72 "name": "callback",
73 "type": "function",
74 "parameters": []
75 }
76 ]
77 },
78 {
46 "name": "returnsEnum", 79 "name": "returnsEnum",
47 "type": "function", 80 "type": "function",
48 "description": "Returns an enum through the callback", 81 "description": "Returns an enum through the callback",
49 "parameters": [ 82 "parameters": [
50 { 83 {
51 "name": "callback", 84 "name": "callback",
52 "type": "function", 85 "type": "function",
53 "parameters": [ 86 "parameters": [
54 { 87 {
55 "name": "state", 88 "name": "state",
56 "type": "string", 89 "type": "string",
57 "enum": ["foo", "bar", "baz"] 90 "enum": ["foo", "bar", "baz"]
58 } 91 }
59 ] 92 ]
60 } 93 }
61 ] 94 ]
62 }, 95 },
63 { 96 {
97 "name": "returnsEnumAsType",
98 "type": "function",
99 "description": "Returns an enum through the callback",
100 "parameters": [
101 {
102 "name": "callback",
103 "type": "function",
104 "parameters": [
105 {
106 "name": "enumeration",
107 "$ref": "Enumeration"
108 }
109 ]
110 }
111 ]
112 },
113 {
64 "name": "returnsTwoEnums", 114 "name": "returnsTwoEnums",
65 "type": "function", 115 "type": "function",
66 "description": "Returns two enums through the callback", 116 "description": "Returns two enums through the callback",
67 "parameters": [ 117 "parameters": [
68 { 118 {
69 "name": "callback", 119 "name": "callback",
70 "type": "function", 120 "type": "function",
71 "parameters": [ 121 "parameters": [
72 { 122 {
73 "name": "firstState", 123 "name": "firstState",
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 { 202 {
153 "name": "secondEnum", 203 "name": "secondEnum",
154 "type": "string", 204 "type": "string",
155 "enum": ["spam", "ham", "eggs"] 205 "enum": ["spam", "ham", "eggs"]
156 } 206 }
157 ] 207 ]
158 } 208 }
159 ] 209 ]
160 } 210 }
161 ] 211 ]
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/model.py ('k') | tools/json_schema_compiler/test/enums_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698