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

Unified Diff: tools/json_schema_compiler/model.py

Issue 39113003: Docserver: Display enum value descriptions in API docs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 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/model.py
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index cc876dfad77730e9d72eaad52c73fff75b63fdf3..385a95acee30233b8362fe910b679a06aad1b805 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -141,7 +141,11 @@ class Type(object):
self.ref_type = json['$ref']
elif 'enum' in json and json_type == 'string':
self.property_type = PropertyType.ENUM
- self.enum_values = [value for value in json['enum']]
+ self.enum_values = []
+ for enum_value in json['enum']:
+ if not isinstance(enum_value, dict):
+ enum_value = {'name': enum_value}
+ self.enum_values.append(enum_value)
not at google - send to devlin 2013/10/28 18:00:25 Rather than users of Model have to access enum['na
Sam McNally 2013/10/29 00:39:02 Done.
elif json_type == 'any':
self.property_type = PropertyType.ANY
elif json_type == 'binary':

Powered by Google App Engine
This is Rietveld 408576698