Fix model JSON generation for combined XMI (TEDM2O-13)#296
Fix model JSON generation for combined XMI (TEDM2O-13)#296gkostkowski merged 3 commits intodevelopfrom
Conversation
Scope of changes: * Added bash options to multiline recipes to fail fast on error * Fixed XPath in JSON generation that was breaking for combined XMI * Added a new test and test data for the merged XMI case * Updated other XPath occurrences to handle the combined XMI case * Attribute range label resolution now accounts for references to elements that may not be defined in the XMI
There was a problem hiding this comment.
Pull request overview
This PR fixes XPath expressions in JSON generation that were breaking when processing combined XMI files that merge multiple modules. When elements from different modules are combined into a single XMI file, duplicate element definitions can exist, causing XPath queries to return multiple results instead of a single element.
Changes:
- Added
set -eo pipefailto Makefile recipes to enable fast-fail on errors in bash commands - Fixed XPath queries to select only the first element when duplicates exist in combined XMI files using the
[1]predicate - Enhanced attribute/association range label resolution to gracefully handle references to elements that may not be defined in the XMI
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Makefile | Added bash error handling (set -eo pipefail) to generate-respec and generate-asciidoc-glossary targets to ensure scripts fail fast on errors |
| src/rspec/rspec-generation.xsl | Fixed XPath queries in three locations to handle combined XMI by selecting first element with [1] predicate and added null checks for undefined element references |
| test/unitTests/test-rspec/test-rspec-generation.xspec | Added test scenario for combined XMI covering two modules to verify correct label resolution across module boundaries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
costezki
left a comment
There was a problem hiding this comment.
Looks fine. Thank you.
Summary