mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 06:57:06 +00:00
Add nullability annotations to Java generated clients (#19617)
* issue-1960: Add nullability annotations to Java generated clients Motivations: Have generated clients properly annotated for nullability to be able to check code using them with tools like NullAway Modifications: * Add nullable_var_annotations template to handle nullability annotation on vars * Add pojo templates to use the nullability template * Adapt tests * issue-1960: Add nullability annotations to Java generated clients Modifications: * Run export_docs_generator.sh script to update samples
This commit is contained in:
@@ -54,12 +54,13 @@ import org.openapitools.client.JSON;
|
||||
public class OneOf1 {
|
||||
public static final String SERIALIZED_NAME_MESSAGE1 = "message1";
|
||||
@SerializedName(SERIALIZED_NAME_MESSAGE1)
|
||||
@javax.annotation.Nullable
|
||||
private String message1;
|
||||
|
||||
public OneOf1() {
|
||||
}
|
||||
|
||||
public OneOf1 message1(String message1) {
|
||||
public OneOf1 message1(@javax.annotation.Nullable String message1) {
|
||||
this.message1 = message1;
|
||||
return this;
|
||||
}
|
||||
@@ -74,7 +75,7 @@ public class OneOf1 {
|
||||
return message1;
|
||||
}
|
||||
|
||||
public void setMessage1(String message1) {
|
||||
public void setMessage1(@javax.annotation.Nullable String message1) {
|
||||
this.message1 = message1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user