Conversation
Complex types were keyed by their local name only, so two types sharing a local name in different namespaces were mapped to the same table. The second one was silently merged into the first, or dropped when the name collision was mistaken for a recursive definition. Types are now keyed per XSD type, appending a numeric suffix when local names collide. Add a documentation page on combining several schemas, covering wrapper schemas replacing xs:any wildcards with the payload schema, and a caveat section about wildcards. Refs cre-dev#77 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TGCUjv7869FF3vgK1ezSV9
Replace the dedicated test model and test module with a sub-case of the orders sample model: 'detail' is declared twice with a different anonymous complex type, so both types share a local name. The existing parametrized tests cover it, and the model output snapshots are regenerated. Replace the page on combining several schemas with a short note in the getting started guide, and point the wildcards caveat to it. Document in CLAUDE.md that bug fixes should stay minimal and be covered by sub-cases of existing sample models and tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYgbAh7586edNcD8HXyvcP
The wildcards and type naming details in the getting started note are already covered by the caveats page, and the cross reference to the note is not needed there. The model output snapshots already fail when two types sharing a local name are merged, so the added test checked nothing new. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYgbAh7586edNcD8HXyvcP
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Complex types were keyed by their local name only, so two types sharing a local name were mapped
to the same table. The second one was either merged into the first or dropped, because the name
collision was mistaken for a recursive definition. Both cases lost data without an error.
This shows up in two ways:
DataModel._get_type_keynow assigns a key per XSD type, appending a numeric suffix and logging awarning when local names collide.
Tests
orders.xsddeclaresdetailtwice with a different anonymous complex type, initemtypeand inshipordertype, with matching data inorder3.xml. The existing parametrized tests cover it, andthe model output snapshots are regenerated. Reverting
model.pymakes 12 of them fail.Compatibility
A schema that already contains such a collision now produces one more table, and the second type
gets a suffixed key. This recovers data that was previously dropped, but the generated model
changes for those schemas.
Docs
A note in the getting started guide on documents mixing several schemas, and a caveat on
xs:anywildcards being discarded.
CLAUDE.mdgets a section asking for minimal bug fixes covered bysub-cases of existing sample models.
Refs #77
🤖 Generated with Claude Code
https://claude.ai/code/session_01DYgbAh7586edNcD8HXyvcP