Index: tools/json_schema_compiler/idl_schema.py |
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py |
index 9779e272e263180a22dc0b707e08dade001e6296..1d3c83ae3b9652767c0f73ec4e56601d8e2b933c 100644 |
--- a/tools/json_schema_compiler/idl_schema.py |
+++ b/tools/json_schema_compiler/idl_schema.py |
@@ -108,10 +108,20 @@ class Typeref(object): |
def process(self, refs): |
properties = self.additional_properties |
+ result = properties |
if self.parent.GetProperty('OPTIONAL', False): |
properties['optional'] = True |
+ # The IDL parser denotes array types by adding a child 'Array' node onto |
+ # the Param node in the Callspec. |
+ for sibling in self.parent.GetChildren(): |
+ if sibling.cls == 'Array' and sibling.GetName() == self.parent.GetName(): |
+ properties['type'] = 'array' |
+ properties['items'] = {} |
+ properties = properties['items'] |
+ break |
+ |
if self.typeref == 'DOMString': |
properties['type'] = 'string' |
elif self.typeref == 'boolean': |
@@ -132,10 +142,11 @@ class Typeref(object): |
properties['type'] = 'function' |
else: |
try: |
- properties = refs[self.typeref] |
+ result = refs[self.typeref] |
Matt Perry
2012/04/12 18:56:53
What is this code path used for? Doesn't this miss
|
except KeyError, e: |
properties['$ref'] = self.typeref |
- return properties |
+ |
+ return result |
class Namespace(object): |
''' |