Chromium Code Reviews| 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': |