diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java index d63d37a7..27cc2ad2 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; public class AbstractEpic> extends AbstractMinimalEpic implements Serializable { private static final long serialVersionUID = 1L; @@ -45,9 +46,16 @@ public String toString() { private References references; private Author author; private List labels; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date startDate; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date dueDate; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date endDate; + private Date createdAt; private Date updatedAt; private Date closedAt; diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Epic.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Epic.java index e73530d7..86556e3b 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Epic.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Epic.java @@ -4,12 +4,17 @@ import org.gitlab4j.models.utils.JacksonJson; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + public class Epic extends AbstractEpic { private static final long serialVersionUID = 1L; private Boolean startDateIsFixed; private Boolean dueDateIsFixed; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date dueDateFromInheritedSource; + private Boolean subscribed; public Boolean getStartDateIsFixed() { diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ImpersonationToken.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ImpersonationToken.java index 7b210b7f..b39102c3 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ImpersonationToken.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ImpersonationToken.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; public class ImpersonationToken implements Serializable { private static final long serialVersionUID = 1L; @@ -52,6 +53,8 @@ public String toString() { private Date createdAt; private Date lastUsedAt; private Boolean impersonation; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date expiresAt; public Boolean getActive() { diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ProjectAccessToken.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ProjectAccessToken.java index 44b6c93e..f2a32911 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ProjectAccessToken.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ProjectAccessToken.java @@ -7,13 +7,18 @@ import org.gitlab4j.models.Constants; import org.gitlab4j.models.utils.JacksonJson; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + public class ProjectAccessToken implements Serializable { private static final long serialVersionUID = 1L; private Long userId; private List scopes; private String name; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date expiresAt; + private Long id; private Boolean active; private Date createdAt; diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/RelatedEpic.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/RelatedEpic.java index 92671519..7b584dab 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/RelatedEpic.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/RelatedEpic.java @@ -4,12 +4,17 @@ import org.gitlab4j.models.utils.JacksonJson; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + public class RelatedEpic extends AbstractEpic { private static final long serialVersionUID = 1L; private Boolean startDateIsFixed; private Boolean dueDateIsFixed; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date dueDateFromInheritedSource; + private Long relatedEpicLinkId; private LinkType linkType; private Date linkCreatedAt; diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/child-epic.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/child-epic.json index cc474e69..3354c896 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/child-epic.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/child-epic.json @@ -22,8 +22,9 @@ "avatar_url": "http://www.gravatar.com/avatar/a2f5c6fcef64c9c69cb8779cb292be1b?s=80&d=identicon", "web_url": "http://gitlab.example.com/arnita" }, - "start_date": "2018-07-01T00:00:00Z", - "due_date": "2018-07-31T00:00:00Z", + "start_date": "2024-12-01", + "end_date": "2024-12-31", + "due_date": "2024-12-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", "closed_at": "2018-08-18T12:22:05.239Z", diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/epic.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/epic.json index 7172c5bc..4c863a14 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/epic.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/epic.json @@ -22,11 +22,11 @@ "avatar_url": "http://www.gravatar.com/avatar/a2f5c6fcef64c9c69cb8779cb292be1b?s=80&d=identicon", "web_url": "http://gitlab.example.com/arnita" }, - "start_date": "2018-07-01T00:00:00Z", + "start_date": "2018-07-01", "start_date_is_fixed": false, - "due_date": "2018-07-31T00:00:00Z", + "due_date": "2018-07-31", "due_date_is_fixed": false, - "due_date_from_inherited_source": "2018-07-31T00:00:00Z", + "due_date_from_inherited_source": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", "closed_at": "2018-08-18T12:22:05.239Z", diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/group-access-token.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/group-access-token.json index d306d3eb..5af8fa97 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/group-access-token.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/group-access-token.json @@ -11,6 +11,6 @@ "user_id": 79, "last_used_at": "2023-09-28T19:26:26.675Z", "active": true, - "expires_at": "2024-06-18T00:00:00Z", + "expires_at": "2024-06-18", "access_level": 40 } \ No newline at end of file diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/impersonation-token.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/impersonation-token.json index a9e5a0bf..d1626baa 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/impersonation-token.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/impersonation-token.json @@ -11,5 +11,5 @@ "last_used_at": "2018-03-17T17:19:28.697Z", "id" : 3, "impersonation" : true, - "expires_at" : "2017-04-14T00:00:00Z" + "expires_at" : "2017-04-14" } diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project-access-token.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project-access-token.json index a2af09ab..58ebb473 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project-access-token.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project-access-token.json @@ -5,7 +5,7 @@ "read_repository" ], "name" : "Project Access Token Name", - "expires_at" : "2021-01-31T00:00:00Z", + "expires_at" : "2021-01-31", "id" : 10, "active" : true, "created_at" : "2021-01-20T22:11:48.151Z", diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/related-epics.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/related-epics.json index 483138a9..dc25acc4 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/related-epics.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/related-epics.json @@ -23,11 +23,11 @@ "avatar_url": "http://www.gravatar.com/avatar/a2f5c6fcef64c9c69cb8779cb292be1b?s=80&d=identicon", "web_url": "http://gitlab.example.com/arnita" }, - "start_date": "2018-07-01T00:00:00Z", + "start_date": "2018-07-01", "start_date_is_fixed": false, - "due_date": "2018-07-31T00:00:00Z", + "due_date": "2018-07-31", "due_date_is_fixed": false, - "due_date_from_inherited_source": "2018-07-31T00:00:00Z", + "due_date_from_inherited_source": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", "closed_at": "2018-08-18T12:22:05.239Z",