Commit 4c546a7e authored by Andrey Veltischev's avatar Andrey Veltischev
Browse files

Merge branch 'vitalii/anyOf_comments' into 'master'

Added coments for allOf property

See merge request !39
parents 42b135b7 ad8622bb
......@@ -46,8 +46,10 @@ class SchemaTransformer:
schema_model['anyOf'] = {}
for ref in model['anyOf']:
if isinstance(ref, dict):
# ^ this condition is needed to avoid of re-expanding expanded schema
schema_model['anyOf'][self._split_model_name(ref['$ref'])] = self.expand_schema_model(schema, ref)
else:
# this case is needed for reuse expanded model schema
schema_model['anyOf'][ref] = self.expand_schema_model(schema, ref)
else:
schema_model = deepcopy(model)
......@@ -136,7 +138,7 @@ class BaseSchemaBuilder:
def _build_poly_model(self, prop_data):
models = []
model_props = self._map_params(prop_data)
is_array = True if 'type' in prop_data and prop_data['type'] == 'array' else False
is_array = 'type' in prop_data and prop_data['type'] == 'array'
allOf_items = prop_data['items']['anyOf'] if is_array else prop_data['anyOf']
for name, model in allOf_items.items():
attr_model = getattr(self.module, name.split('.')[-1], None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment