MAINT: update schemapi.utils to handle lists of schemas
@@ -182,7 +182,10 @@ class SchemaInfo(object):
'boolean': 'boolean',
'array': 'list',
'null': 'None'}
- if self.is_empty():
+ if self.is_list():
+ return '[{0}]'.format(', '.join(self.child(s).short_description
+ for s in self.schema))
+ elif self.is_empty():
return 'any object'
elif self.is_enum():
return 'enum({})'.format(', '.join(map(repr, self.enum)))
@@ -284,6 +287,9 @@ class SchemaInfo(object):
return self.raw_schema.get('description',
self.schema.get('description', ''))
+ def is_list(self):
+ return isinstance(self.schema, list)
+
def is_reference(self):
return '$ref' in self.raw_schema
