Skip to content

Commit 30dc929

Browse files
committed
Changed the type for notableType to String (#279).
1 parent d53ad63 commit 30dc929

File tree

1 file changed

+8
-3
lines changed
  • src/main/java/org/gitlab4j/api/models

1 file changed

+8
-3
lines changed

src/main/java/org/gitlab4j/api/models/Note.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public String toString() {
3838
}
3939
}
4040

41+
// This is not used because the GitLab example JSON is using a funny string for the MERGE_REQUEST notable_type ("Merge request").
42+
// Once they fix the bug, the notableType field can be changed from String to NotableType.
4143
public static enum NoteableType {
4244

4345
COMMIT, EPIC, ISSUE, MERGE_REQUEST, SNIPPET;
@@ -89,7 +91,10 @@ public String toString() {
8991
private String fileName;
9092
private Integer id;
9193
private Integer noteableId;
92-
private NoteableType noteableType;
94+
95+
// Use String for noteableType until the constant is fixed in the GitLab API
96+
private String noteableType;
97+
9398
private Integer noteableIid;
9499
private Boolean system;
95100
private String title;
@@ -172,11 +177,11 @@ public void setNoteableId(Integer noteableId) {
172177
this.noteableId = noteableId;
173178
}
174179

175-
public NoteableType getNoteableType() {
180+
public String getNoteableType() {
176181
return noteableType;
177182
}
178183

179-
public void setNoteableType(NoteableType noteableType) {
184+
public void setNoteableType(String noteableType) {
180185
this.noteableType = noteableType;
181186
}
182187

0 commit comments

Comments
 (0)