Index: tools/json_schema_compiler/schema_loader.py |
diff --git a/tools/json_schema_compiler/schema_loader.py b/tools/json_schema_compiler/schema_loader.py |
index c434dc167462a26a6e913a28e50d8b9bb79a4126..4638a8c82d794a8dd13873bb0cb0ef4773081574 100644 |
--- a/tools/json_schema_compiler/schema_loader.py |
+++ b/tools/json_schema_compiler/schema_loader.py |
@@ -12,8 +12,9 @@ from model import Model |
class SchemaLoader(object): |
'''Resolves a type name into the namespace the type belongs to. |
''' |
- def __init__(self, api_path): |
+ def __init__(self, api_path, multiple_schemas=False): |
self._api_path = api_path |
+ self._multiple_schemas = multiple_schemas |
def ResolveType(self, full_name, default_namespace): |
name_parts = full_name.rsplit('.', 1) |
@@ -46,7 +47,7 @@ class SchemaLoader(object): |
else: |
sys.exit('Did not recognize file extension %s for schema %s' % |
(schema_extension, schema)) |
- if len(api_defs) != 1: |
+ if len(api_defs) != 1 and not self._multiple_schemas: |
sys.exit('File %s has multiple schemas. Files are only allowed to contain' |
'a single schema.' % schema) |
not at google - send to devlin
2013/09/13 21:37:52
meh, just kill this check and don't pass in that b
dhnishi (use Chromium)
2013/09/16 22:26:21
Done.
|