fix: export-jdl preserves destination-side relationship annotations#32662
Merged
mshima merged 1 commit intojhipster:mainfrom Mar 12, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes export-jdl so that relationship annotations/options defined on the destination (right) side of a bidirectional relationship are preserved when converting JSON entities back into JDL.
Changes:
- Extract destination-side relationship
optionsfrom the matched right-side relationship entry. - Map those extracted options into
JDLRelationship.options.destinationduring JSON → JDL conversion. - Extend unit/integration coverage and update snapshots to assert destination-side annotations appear in exported JDL.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/jdl/converters/json-to-jdl-entity-converter.ts | Maps right-side relationship options into JDLRelationship.options.destination when constructing the merged relationship. |
| lib/jdl/converters/json-to-jdl-entity-converter.spec.ts | Adds a unit test asserting destination-side relationship options are parsed into options.destination. |
| generators/export-jdl/export-jdl.spec.ts | Adds options to a right-side relationship fixture to validate end-to-end behavior. |
| generators/export-jdl/snapshots/export-jdl.spec.ts.snap | Updates snapshots to confirm destination annotations render on the destination entity side in the exported JDL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
9 tasks
mshima
approved these changes
Mar 12, 2026
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.
Summary
export-jdlbecausegetDestinationEntitySideAttributes()never extractedoptionsfrom the matched right-side relationshipJDLRelationship.options.destinationExample
JDL example that demonstrates the fix:
// Before the fix, @CustomTag annotation was lost during export-jdl round-trip
The @CustomTag on the destination side (Book) would be silently dropped when running jhipster export-jdl. After the fix, it is now preserved.
Closes #32655
Test plan
json-to-jdl-entity-converter.spec.tsoptions: { destinationAnnotation: true }to right-side relationship inexport-jdl.spec.tsPlease make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-cilabel, you can still see CI build result at your branch.