-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated POJO has compilation error when GraphQL type has field named "class" #994
Comments
@arturshevchenko I've made one fix to handle a field named "class", so that the generated POJO for your GraphQL type will be: public class Ship implements java.io.Serializable {
...
private String Class;
public Ship() {
}
public Ship(... , String Class) {
...
this.Class = Class;
}
...
public String GetClass() {
return Class;
}
public void setClass(String Class) {
this.Class = Class;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final Ship that = (Ship) obj;
return ...
&& Objects.equals(Class, that.Class);
}
@Override
public int hashCode() {
return Objects.hash(..., Class);
}
@Override
public String toString() {
StringJoiner joiner = new StringJoiner(", ", "{ ", " }");
...
if (Class != null) {
joiner.add("class: " + GraphQLRequestSerializer.getEntry(Class));
}
return joiner.toString();
}
public static Ship.Builder builder() {
return new Ship.Builder();
}
public static class Builder {
...
private String Class;
public Builder() {
}
...
public Builder setClass(String Class) {
this.Class = Class;
return this;
}
public Ship build() {
return new Ship(..., Class);
}
}
} |
kobylynskyi
added a commit
that referenced
this issue
Sep 5, 2022
1 task
kobylynskyi
added a commit
that referenced
this issue
Sep 5, 2022
kobylynskyi
added a commit
that referenced
this issue
Sep 5, 2022
The fix will be released in 5.5.0 soon |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ability to rename field names
problem is: (getClass method)
need to rename
thanks
The text was updated successfully, but these errors were encountered: