Skip to content

Commit

Permalink
fix(types): nested types work for arrays
Browse files Browse the repository at this point in the history
Thanks to removed code which made no sense to me, I put in a bug.
Now the code is back, beta than ever, and documented as well :).
  • Loading branch information
Byron committed Mar 11, 2015
1 parent 50fa189 commit 54540e6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mako/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,14 @@ def iter_nested_properties(prefix, properties):
ns.id = nested_type_name(prefix, pn)
ns[NESTED_TYPE_MARKER] = True

# To allow us recursing arrays, we simply put items one level up
if 'items' in p:
ns.update((k, deepcopy(v)) for k, v in p.items.iteritems())

yield ns

for np in iter_nested_properties(prefix + canonical_type_name(pn), ns.properties):
yield np
if 'properties' in ns:
for np in iter_nested_properties(prefix + canonical_type_name(pn), ns.properties):
yield np
elif _is_map_prop(p):
# it's a hash, check its type
for np in iter_nested_properties(prefix, {pn: p.additionalProperties}):
Expand Down

0 comments on commit 54540e6

Please sign in to comment.