Skip to content

Commit b8bd0eb

Browse files
committed
walk schema for traversable nodes
1 parent d74b551 commit b8bd0eb

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

asdf/_node_info.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,11 @@ def from_root_node(
401401
if root_info is None:
402402
root_info = info
403403

404+
if parent is None:
405+
info.schema = schema
406+
404407
if parent is not None:
405-
# Why check that __asdf_traverse__ doesn't exist here?
406-
# If the parent has a schema and the identifier is in
407-
# the schema we have a valid subschema for this node.
408-
# Why does it matter if it does or doesn't support
409-
# __asdf_traverse__ (as that only determines the
410-
# children).
411-
if parent.schema is not None and not traversable:
408+
if parent.schema is not None:
412409
# descend within the schema of the parent
413410
info.set_schema_for_property(parent, identifier)
414411

@@ -433,9 +430,6 @@ def from_root_node(
433430
# be using _tag for a non-ASDF purpose.
434431
pass
435432

436-
if parent is None:
437-
info.schema = schema
438-
439433
# add children to queue
440434
for child_identifier, child_node in get_children(t_node):
441435
next_nodes.append((info, child_identifier, child_node))

0 commit comments

Comments
 (0)