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 1b353ac74a0589aa39ac546f9851c9c84b793e1b..4aad4c16761e09cff31604641d88ff61f8be4dab 100644 |
| --- a/tools/json_schema_compiler/model.py |
| +++ b/tools/json_schema_compiler/model.py |
| @@ -190,7 +190,10 @@ class Property(object): |
| elif '$ref' in json: |
| self.ref_type = json['$ref'] |
| self.type_ = PropertyType.REF |
| - elif 'enum' in json: |
| + elif 'enum' in json and all(isinstance(value, basestring) |
|
asargent_no_longer_on_chrome
2012/07/02 23:43:48
This isinstance test seems kind of hacky - can we
benjhayden
2012/07/09 20:18:09
Done.
|
| + for value in json['enum']): |
| + # If enum values are not all strings (as in the case of |
| + # [legalValues=(1,2)]), fall through to the next elif. |
| self.enum_values = [] |
| for value in json['enum']: |
| self.enum_values.append(value) |