java-spring-template icon indicating copy to clipboard operation
java-spring-template copied to clipboard

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

Open anessi opened this issue 9 months ago • 1 comments

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?

  • [x] 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 avatar Mar 24 '25 10:03 anessi

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.

github-actions[bot] avatar Mar 24 '25 10:03 github-actions[bot]