Index: tools/json_schema_compiler/model.py |
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py |
index 63973d43405e939a1416c0b51d339807005d8a16..bb3fe0e9dd2192c17117c5be6c4e18887be2f751 100644 |
--- a/tools/json_schema_compiler/model.py |
+++ b/tools/json_schema_compiler/model.py |
@@ -193,7 +193,9 @@ 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 json.get('type') == 'string': |
+ # Non-string enums (as in the case of [legalValues=(1,2)]) should fall |
+ # through to the next elif. |
self.enum_values = [] |
for value in json['enum']: |
self.enum_values.append(value) |