Code: Select all
"date1": {
"type": "string",
"description": "Date 1",
"format": "date-time"
},
"date2": {
"type": "string",
"description": "Date 2",
"format": "date-time"
}
< /code>
{
"date1": "2021-07-29T03:00:00",
"date2": "2021-04-22T08:25:30.264Z"
}
< /code>
By default, the open api-generator-maven-plugin creates the OffsetDateTime type for date-time
Code: Select all
@JsonProperty("date1")
private OffsetDateTime date1;
@JsonProperty("date2")
private OffsetDateTime date2;
< /code>
With typeMappings
Code: Select all
OffsetDateTime=LocalDateTime
java.time.OffsetDateTime=java.time.LocalDateTime
< /code>
But this replacement will happen for all fields:
@JsonProperty("date1")
private LocalDateTime date1;
@JsonProperty("date2")
private LocalDateTime date2;
< /code>
Is there a way to replace OffsetDateTime with LocalDateTime for date1
Das möchte ich in der generierten Klasse sehen:
@JsonProperty("date1")
private LocalDateTime date1;
@JsonProperty("date2")
private OffsetDateTime date2;
< /code>
I understand that I can fix the generated class and replace OffsetDateTime with LocalDateTime, but I don't want to change the generated class every time after generation.
Thanks in advance.