Skip to content

Commit 1d9f243

Browse files
committed
fix: use parameter generateTimestamp to suppress timestamp in @generated annotation #433
Signed-off-by: anessi <[email protected]>
1 parent 4e2766b commit 1d9f243

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ It is RECOMMENDED to not use anonymous objects in payload and components definit
8787
|completionTimeout|Only for MQTT. The completion timeout in milliseconds for operations. The default completion timeout is 30000 milliseconds.| No | `30000` |
8888
|mqttClientId| Only for MQTT. Provides the client identifier for the MQTT server. This parameter overrides the value of the clientId if it's set in the AsyncAPI file.If both aren't provided, a default value is set.| No | |
8989
|asyncapiFileDir| Path where original AsyncAPI file will be stored.| No | `src/main/resources/api/` |
90+
|generateTimestamp| Adds the generation timestamp to the @Generated annotation.| No | `true` |
9091
### Examples
9192

9293
The shortest possible syntax:

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@
117117
"description": "Generate pom.xml Maven build file instead of Gradle build",
118118
"default": false,
119119
"required": false
120+
},
121+
"generateTimestamp": {
122+
"description": "Adds the generation timestamp to the @Generated annotation",
123+
"default": "true",
124+
"required": false
120125
}
121126
},
122127
"generator": ">=1.8.27 <2.0.0",

template/src/main/java/com/asyncapi/model/$$objectSchema$$.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* {{ line | safe}}{% endfor %}{% if schema.examples() %}
2222
* Examples: {{schema.examples() | examplesToString | safe}}{% endif %}
2323
*/{% endif %}
24-
@Generated(value="com.asyncapi.generator.template.spring", date="{{''|currentTime }}")
24+
@Generated(value="com.asyncapi.generator.template.spring"{% if params.generateTimestamp === 'true' %}, date="{{''|currentTime }}"{%- endif %})
2525
public class {{schemaName | camelCase | upperFirst}} {
2626
{% for propName, prop in schema.properties() %}
2727
{%- set isRequired = propName | isRequired(schema.required()) %}

0 commit comments

Comments
 (0)