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

Unified 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: more testing of optional enums Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/test/enums.json
diff --git a/tools/json_schema_compiler/test/enums.json b/tools/json_schema_compiler/test/enums.json
index ae6be004d84a5facc09f945ce79bad0acb5459d0..48c2c980ddf5526168c9be83dd5a948c8b81a2ea 100644
--- a/tools/json_schema_compiler/test/enums.json
+++ b/tools/json_schema_compiler/test/enums.json
@@ -3,6 +3,10 @@
"namespace": "enums",
"types": [
{
+ "id": "Enumeration",
+ "enum": ["none", "one", "two", "three"]
+ },
+ {
"id": "EnumType",
"type": "object",
"properties": {
@@ -13,6 +17,19 @@
}
},
{
+ "id": "HasEnumeration",
+ "type": "object",
+ "properties": {
+ "enumeration": {
+ "$ref": "Enumeration"
+ },
+ "optional_enumeration": {
+ "$ref": "Enumeration",
+ "optional": true
+ }
+ }
+ },
+ {
"id": "OptionalEnumType",
"type": "object",
"properties": {
@@ -43,6 +60,22 @@
]
},
{
+ "name": "takesEnumAsType",
+ "type": "function",
+ "description": "Takes an enum type as its parameter.",
+ "parameters": [
+ {
+ "name": "enumeration",
+ "$ref": "Enumeration"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": []
+ }
+ ]
+ },
+ {
"name": "returnsEnum",
"type": "function",
"description": "Returns an enum through the callback",
@@ -61,6 +94,23 @@
]
},
{
+ "name": "returnsEnumAsType",
+ "type": "function",
+ "description": "Returns an enum through the callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "enumeration",
+ "$ref": "Enumeration"
+ }
+ ]
+ }
+ ]
+ },
+ {
"name": "returnsTwoEnums",
"type": "function",
"description": "Returns two enums through the callback",

Powered by Google App Engine
This is Rietveld 408576698