fix: export-jdl now preserves field-level annotations (@Id, custom op…#32655
Merged
mshima merged 2 commits intojhipster:mainfrom Mar 11, 2026
Merged
Conversation
…tions) The JSON-to-JDL entity converter was not passing field.options to the JDLField constructor, causing all field-level annotations to be silently dropped during JDL export.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes export-jdl dropping field-level annotations by ensuring .jhipster field options are carried into JDLField, so annotations like @Id and custom @AnnotationName("value") are preserved in generated JDL (addresses #32435).
Changes:
- Pass
field.optionsinto theJDLFieldconstructor during JSON→JDL conversion. - Extend
export-jdltest fixtures to include fieldoptionsfor@Idand a custom annotation. - Update snapshots to assert the exported JDL contains
@Idand@CustomAnnotation("customValue").
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/jdl/converters/json-to-jdl-entity-converter.ts | Preserves field-level annotations by forwarding field.options into JDLField. |
| generators/export-jdl/export-jdl.spec.ts | Adds test inputs that include options to validate annotation export behavior. |
| generators/export-jdl/snapshots/export-jdl.spec.ts.snap | Updates expected exported JDL output to include the new annotations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5 tasks
DanielFran
previously approved these changes
Mar 11, 2026
mshima
approved these changes
Mar 11, 2026
Member
|
I’ve forgot to check relationships. |
9 tasks
Contributor
Author
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.
The JSON-to-JDL entity converter was not passing field.options to the JDLField constructor, causing all field-level annotations to be silently dropped during JDL export.
Summary
@Id, custom@AnnotationName(value)) were silently dropped duringexport-jdlbecausefield.optionswas not passed to theJDLFieldconstructor injson-to-jdl-entity-converter.tsoptions: field.optionsto the constructor call (1-line fix)@Idand@CustomAnnotation("customValue")field optionsTest plan
npx esmocha generators/export-jdl --no-insight— all 5 tests pass@Idand@CustomAnnotation("customValue")appear in exported JDLjhipster export-jdlon a project with field annotations and verify they appear in the outputPlease 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.Closes #32435