You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the com.netflix.dgs.codegen gradle plugin version 8.1.0
Apparently the generated code does not care whether a field is marked as Non-Null or not.
Can it be configured so we cannot create objects with null values if they are marked as Non-Null?
Example:
input MySampleInput {
data: String
}
and
input MySampleInput {
data: String!
}
currenty results in the same generated class:
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
public class MySampleInput {
private String data;
public MySampleInput() {
}
public MySampleInput(String data) {
this.data = data;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@Override
public String toString() {
return "MySampleInput{data='" + data + "'}";
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MySampleInput that = (MySampleInput) o;
return Objects.equals(data, that.data);
}
@Override
public int hashCode() {
return Objects.hash(data);
}
public static Builder newBuilder() {
return new Builder();
}
public static class Builder {
private String data;
public MySampleInput build() {
MySampleInput result = new MySampleInput();
result.data = this.data;
return result;
}
public Builder data(String data) {
this.data = data;
return this;
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the com.netflix.dgs.codegen gradle plugin version 8.1.0
Apparently the generated code does not care whether a field is marked as Non-Null or not.
Can it be configured so we cannot create objects with null values if they are marked as Non-Null?
Example:
and
currenty results in the same generated class:
Beta Was this translation helpful? Give feedback.
All reactions