Skip to content

[FEATURE] Add parameter to suppress timestamp in @Generated annotation #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
anessi opened this issue Mar 24, 2025 · 1 comment
Open
2 tasks done
Labels
enhancement New feature or request

Comments

@anessi
Copy link

anessi commented Mar 24, 2025

Why do we need this improvement?

In the generated classes a @Generated annotation is added with a date attribute that contains the time when the classes got generated.

It would be nice to have a parameter that allows to not add the date attribute.

The current approach makes totally sense when you generate the classes during the build and don't checking them in to your VCS. However, when checking-in the generated code, the date attribute causes a diff each time it is re-generated. The date is not needed because this is tracked in the VCS.
We are checkin-in the code because we don't have the ability to call npm during the build.

How will this change help?

For people that check-in their generated code, removing the date attribute would only show the relevant changes in the VCS diff and not irrelevant time-stamp changes.

Screenshots

No response

How could it be implemented/designed?

A parameter could be added and the templates updated, to allow to suppress the date field.
See https://github.com/asyncapi/java-spring-template/blob/master/template/src/main/java/com/asyncapi/model/%24%24message%24%24.java#L17 for more details.

🚧 Breaking changes

No

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

@anessi anessi added the enhancement New feature or request label Mar 24, 2025
Copy link

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant