Skip to content

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

@anessi

Description

@anessi

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions