Skip to content

Fix KeyError when xs:choice branches share an element with same name and type#60

Merged
martinv13 merged 2 commits into
cre-dev:mainfrom
martinv13:fix/duplicate-element-choice-branches
Jun 13, 2026
Merged

Fix KeyError when xs:choice branches share an element with same name and type#60
martinv13 merged 2 commits into
cre-dev:mainfrom
martinv13:fix/duplicate-element-choice-branches

Conversation

@martinv13

Copy link
Copy Markdown
Collaborator

In add_relation_1/add_relation_n, skip duplicate relations where a field with the same name and same XSD type already exists. Previously, self.fields (a list) accumulated both occurrences while self.relations_1/n (dicts) only kept the last, causing a KeyError in simplify_table when the first occurrence was elevated and the second tried to look it up.

Add deliveryType to the orders crash-test schema to cover this case, with order3.xml exercising both the sequence branch (from+to) and standalone branch (to).

martinv13 and others added 2 commits June 11, 2026 16:12
…and type

In add_relation_1/add_relation_n, skip duplicate relations where a field with
the same name and same XSD type already exists. Previously, self.fields (a list)
accumulated both occurrences while self.relations_1/n (dicts) only kept the last,
causing a KeyError in simplify_table when the first occurrence was elevated and
the second tried to look it up.

Add deliveryType to the orders crash-test schema to cover this case, with
order3.xml exercising both the sequence branch (from+to) and standalone branch (to).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@martinv13 martinv13 merged commit df6977d into cre-dev:main Jun 13, 2026
9 checks passed
@martinv13 martinv13 deleted the fix/duplicate-element-choice-branches branch June 13, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant