Skip to content

Commit dbc4a7e

Browse files
committed
Add Jackson annotation
1 parent 09890ad commit dbc4a7e

File tree

149 files changed

+2073
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+2073
-19
lines changed

GenerateGitlabClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ public static Config createConfig(Schema schema) {
239239
.addIncludeName("TodoMarkDonePayload") //
240240
;
241241
Config config = new Config()
242+
.setUseJacksonAnnotation()
242243
.setSchema(schema)
243244
.setDefaultCustomScalarMapping(CustomScalarMappingStrategy.CREATE_CUSTOM_SCALAR_CLASS)
244245
.setScope(new Scope()

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ repositories {
1313
}
1414

1515
dependencies {
16+
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.16.2'
1617
implementation 'org.eclipse.microprofile.graphql:microprofile-graphql-api:2.0'
1718
implementation "io.smallrye:smallrye-graphql-api:$smallrye_graphql_version"
1819
implementation "io.smallrye:smallrye-graphql-client-api:$smallrye_graphql_version"

src/main/java/graphql/gitlab/model/AwardEmoji.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import org.eclipse.microprofile.graphql.Name;
66

7+
import com.fasterxml.jackson.annotation.JsonProperty;
8+
79
/**
810
* An emoji awarded by a user
911
*/
@@ -52,6 +54,19 @@ public AwardEmoji setUnicodeVersion(String unicodeVersion) {
5254
return this;
5355
}
5456

57+
@JsonProperty("__typename")
58+
public String getTypename() {
59+
return "AwardEmoji";
60+
}
61+
62+
@JsonProperty("__typename")
63+
public void setTypename(String type) {
64+
//Setter only for Jackson
65+
if(!"AwardEmoji".equals(type)) {
66+
throw new IllegalArgumentException("Unexpected '__typename' value: " + type);
67+
}
68+
}
69+
5570
@Override
5671
public int hashCode() {
5772
return Objects.hash(name, unicode, unicodeVersion);

src/main/java/graphql/gitlab/model/AwardEmojiAddInput.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import org.eclipse.microprofile.graphql.Name;
66

7+
import com.fasterxml.jackson.annotation.JsonProperty;
8+
79
import graphql.gitlab.GitLabInputRequest;
810

911
/**
@@ -54,6 +56,19 @@ public AwardEmojiAddInput setName(String name) {
5456
return this;
5557
}
5658

59+
@JsonProperty("__typename")
60+
public String getTypename() {
61+
return "AwardEmojiAddInput";
62+
}
63+
64+
@JsonProperty("__typename")
65+
public void setTypename(String type) {
66+
//Setter only for Jackson
67+
if(!"AwardEmojiAddInput".equals(type)) {
68+
throw new IllegalArgumentException("Unexpected '__typename' value: " + type);
69+
}
70+
}
71+
5772
@Override
5873
public int hashCode() {
5974
return Objects.hash(clientMutationId, awardableId, name);

src/main/java/graphql/gitlab/model/AwardEmojiAddPayload.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import org.eclipse.microprofile.graphql.Name;
77

8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
810
import graphql.gitlab.GitLabPayloadResponse;
911

1012
/**
@@ -55,6 +57,19 @@ public AwardEmojiAddPayload setErrors(List<String> errors) {
5557
return this;
5658
}
5759

60+
@JsonProperty("__typename")
61+
public String getTypename() {
62+
return "AwardEmojiAddPayload";
63+
}
64+
65+
@JsonProperty("__typename")
66+
public void setTypename(String type) {
67+
//Setter only for Jackson
68+
if(!"AwardEmojiAddPayload".equals(type)) {
69+
throw new IllegalArgumentException("Unexpected '__typename' value: " + type);
70+
}
71+
}
72+
5873
@Override
5974
public int hashCode() {
6075
return Objects.hash(awardEmoji, clientMutationId, errors);

src/main/java/graphql/gitlab/model/AwardEmojiConnection.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import org.eclipse.microprofile.graphql.Name;
77

8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
810
/**
911
* The connection type for AwardEmoji.
1012
*/
@@ -25,6 +27,19 @@ public AwardEmojiConnection setNodes(List<AwardEmoji> nodes) {
2527
return this;
2628
}
2729

30+
@JsonProperty("__typename")
31+
public String getTypename() {
32+
return "AwardEmojiConnection";
33+
}
34+
35+
@JsonProperty("__typename")
36+
public void setTypename(String type) {
37+
//Setter only for Jackson
38+
if(!"AwardEmojiConnection".equals(type)) {
39+
throw new IllegalArgumentException("Unexpected '__typename' value: " + type);
40+
}
41+
}
42+
2843
@Override
2944
public int hashCode() {
3045
return Objects.hash(nodes);

src/main/java/graphql/gitlab/model/AwardableID.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
import org.eclipse.microprofile.graphql.Name;
66

7+
import com.fasterxml.jackson.annotation.JsonCreator;
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
import com.fasterxml.jackson.annotation.JsonValue;
10+
711
/**
812
* A `AwardableID` is a global ID. It is encoded as a string.
913
*
@@ -14,7 +18,8 @@ public class AwardableID {
1418

1519
private String value;
1620

17-
public AwardableID(String value) {
21+
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
22+
public AwardableID(@JsonProperty("value") String value) {
1823
this.value = value;
1924
}
2025

@@ -23,6 +28,7 @@ public static AwardableID valueOf(String value) {
2328
}
2429

2530
@Override
31+
@JsonValue
2632
public String toString() {
2733
return value;
2834
}

src/main/java/graphql/gitlab/model/Board.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import org.eclipse.microprofile.graphql.Name;
66

7+
import com.fasterxml.jackson.annotation.JsonProperty;
8+
79
/**
810
* Represents a project or group issue board
911
*/
@@ -206,6 +208,19 @@ public Board setWeight(Integer weight) {
206208
return this;
207209
}
208210

211+
@JsonProperty("__typename")
212+
public String getTypename() {
213+
return "Board";
214+
}
215+
216+
@JsonProperty("__typename")
217+
public void setTypename(String type) {
218+
//Setter only for Jackson
219+
if(!"Board".equals(type)) {
220+
throw new IllegalArgumentException("Unexpected '__typename' value: " + type);
221+
}
222+
}
223+
209224
@Override
210225
public int hashCode() {
211226
return Objects.hash(assignee, createdAt, hideBacklogList, hideClosedList, id, iteration, iterationCadence, labels, lists, milestone, name, updatedAt, webUrl, weight);

src/main/java/graphql/gitlab/model/BoardConnection.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import org.eclipse.microprofile.graphql.Name;
77

8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
810
/**
911
* The connection type for Board.
1012
*/
@@ -25,6 +27,19 @@ public BoardConnection setNodes(List<BoardRef> nodes) {
2527
return this;
2628
}
2729

30+
@JsonProperty("__typename")
31+
public String getTypename() {
32+
return "BoardConnection";
33+
}
34+
35+
@JsonProperty("__typename")
36+
public void setTypename(String type) {
37+
//Setter only for Jackson
38+
if(!"BoardConnection".equals(type)) {
39+
throw new IllegalArgumentException("Unexpected '__typename' value: " + type);
40+
}
41+
}
42+
2843
@Override
2944
public int hashCode() {
3045
return Objects.hash(nodes);

src/main/java/graphql/gitlab/model/BoardID.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
import org.eclipse.microprofile.graphql.Name;
66

7+
import com.fasterxml.jackson.annotation.JsonCreator;
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
import com.fasterxml.jackson.annotation.JsonValue;
10+
711
/**
812
* A `BoardID` is a global ID. It is encoded as a string.
913
*
@@ -14,7 +18,8 @@ public class BoardID {
1418

1519
private String value;
1620

17-
public BoardID(String value) {
21+
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
22+
public BoardID(@JsonProperty("value") String value) {
1823
this.value = value;
1924
}
2025

@@ -23,6 +28,7 @@ public static BoardID valueOf(String value) {
2328
}
2429

2530
@Override
31+
@JsonValue
2632
public String toString() {
2733
return value;
2834
}

0 commit comments

Comments
 (0)