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

Unified Diff: tools/json_schema_compiler/cpp_util.py

Issue 10022005: Let json schema compiler handle using arrays as types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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/cpp_util.py
diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py
index 0886826b7a99dd73bc5a505d49dce5200952cc65..69c4bb6afdc38bc1918b45d1fd8f1478689ec633 100644
--- a/tools/json_schema_compiler/cpp_util.py
+++ b/tools/json_schema_compiler/cpp_util.py
@@ -54,7 +54,8 @@ def GetValueType(prop):
PropertyType.BOOLEAN: 'Value::TYPE_BOOLEAN',
PropertyType.DOUBLE: 'Value::TYPE_DOUBLE',
PropertyType.ENUM: 'Value::TYPE_STRING',
- PropertyType.REF: 'Value::TYPE_DICTIONARY',
+ PropertyType.REF: 'Value::TYPE_LIST' if prop.is_array
+ else 'Value::TYPE_DICTIONARY',
PropertyType.OBJECT: 'Value::TYPE_DICTIONARY',
PropertyType.ARRAY: 'Value::TYPE_LIST',
}[prop.type_]

Powered by Google App Engine
This is Rietveld 408576698