Skip to content

Commit

Permalink
issue-1960: Add nullability annotations to Java generated clients
Browse files Browse the repository at this point in the history
Modifications:
* Run export_docs_generator.sh script to update samples
  • Loading branch information
nvervelle committed Sep 18, 2024
1 parent 58a5b8a commit b723dd9
Show file tree
Hide file tree
Showing 1,571 changed files with 14,763 additions and 9,886 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
public class Bird {
public static final String JSON_PROPERTY_SIZE = "size";
@javax.annotation.Nullable
private String size;

public static final String JSON_PROPERTY_COLOR = "color";
@javax.annotation.Nullable
private String color;

public Bird() {
}

public Bird size(String size) {
public Bird size(@javax.annotation.Nullable String size) {

this.size = size;
return this;
Expand All @@ -65,11 +67,11 @@ public String getSize() {

@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSize(String size) {
public void setSize(@javax.annotation.Nullable String size) {
this.size = size;
}

public Bird color(String color) {
public Bird color(@javax.annotation.Nullable String color) {

this.color = color;
return this;
Expand All @@ -90,7 +92,7 @@ public String getColor() {

@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setColor(String color) {
public void setColor(@javax.annotation.Nullable String color) {
this.color = color;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
public class Category {
public static final String JSON_PROPERTY_ID = "id";
@javax.annotation.Nullable
private Long id;

public static final String JSON_PROPERTY_NAME = "name";
@javax.annotation.Nullable
private String name;

public Category() {
}

public Category id(Long id) {
public Category id(@javax.annotation.Nullable Long id) {

this.id = id;
return this;
Expand All @@ -65,11 +67,11 @@ public Long getId() {

@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(Long id) {
public void setId(@javax.annotation.Nullable Long id) {
this.id = id;
}

public Category name(String name) {
public Category name(@javax.annotation.Nullable String name) {

this.name = name;
return this;
Expand All @@ -90,7 +92,7 @@ public String getName() {

@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
public void setName(@javax.annotation.Nullable String name) {
this.name = name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,22 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
public class DataQuery extends Query {
public static final String JSON_PROPERTY_SUFFIX = "suffix";
@javax.annotation.Nullable
private String suffix;

public static final String JSON_PROPERTY_TEXT = "text";
@javax.annotation.Nullable
private String text;

public static final String JSON_PROPERTY_DATE = "date";
@javax.annotation.Nullable
private OffsetDateTime date;

public DataQuery() {

}

public DataQuery suffix(String suffix) {
public DataQuery suffix(@javax.annotation.Nullable String suffix) {

this.suffix = suffix;
return this;
Expand All @@ -75,11 +78,11 @@ public String getSuffix() {

@JsonProperty(JSON_PROPERTY_SUFFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSuffix(String suffix) {
public void setSuffix(@javax.annotation.Nullable String suffix) {
this.suffix = suffix;
}

public DataQuery text(String text) {
public DataQuery text(@javax.annotation.Nullable String text) {

this.text = text;
return this;
Expand All @@ -100,11 +103,11 @@ public String getText() {

@JsonProperty(JSON_PROPERTY_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setText(String text) {
public void setText(@javax.annotation.Nullable String text) {
this.text = text;
}

public DataQuery date(OffsetDateTime date) {
public DataQuery date(@javax.annotation.Nullable OffsetDateTime date) {

this.date = date;
return this;
Expand All @@ -125,18 +128,18 @@ public OffsetDateTime getDate() {

@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDate(OffsetDateTime date) {
public void setDate(@javax.annotation.Nullable OffsetDateTime date) {
this.date = date;
}

@Override
public DataQuery id(Long id) {
public DataQuery id(@javax.annotation.Nullable Long id) {
this.setId(id);
return this;
}

@Override
public DataQuery outcomes(List<OutcomesEnum> outcomes) {
public DataQuery outcomes(@javax.annotation.Nullable List<OutcomesEnum> outcomes) {
this.setOutcomes(outcomes);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
public class DefaultValue {
public static final String JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT = "array_string_enum_ref_default";
@javax.annotation.Nullable
private List<StringEnumRef> arrayStringEnumRefDefault = new ArrayList<>(Arrays.asList(StringEnumRef.SUCCESS, StringEnumRef.FAILURE));

/**
Expand Down Expand Up @@ -90,30 +91,37 @@ public static ArrayStringEnumDefaultEnum fromValue(String value) {
}

public static final String JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT = "array_string_enum_default";
@javax.annotation.Nullable
private List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault = new ArrayList<>(Arrays.asList(ArrayStringEnumDefaultEnum.SUCCESS, ArrayStringEnumDefaultEnum.FAILURE));

public static final String JSON_PROPERTY_ARRAY_STRING_DEFAULT = "array_string_default";
@javax.annotation.Nullable
private List<String> arrayStringDefault = new ArrayList<>(Arrays.asList("failure", "skipped"));

public static final String JSON_PROPERTY_ARRAY_INTEGER_DEFAULT = "array_integer_default";
@javax.annotation.Nullable
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));

public static final String JSON_PROPERTY_ARRAY_STRING = "array_string";
@javax.annotation.Nullable
private List<String> arrayString = new ArrayList<>();

public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable";
@javax.annotation.Nullable
private JsonNullable<List<String>> arrayStringNullable = JsonNullable.<List<String>>undefined();

public static final String JSON_PROPERTY_ARRAY_STRING_EXTENSION_NULLABLE = "array_string_extension_nullable";
@javax.annotation.Nullable
private JsonNullable<List<String>> arrayStringExtensionNullable = JsonNullable.<List<String>>undefined();

public static final String JSON_PROPERTY_STRING_NULLABLE = "string_nullable";
@javax.annotation.Nullable
private JsonNullable<String> stringNullable = JsonNullable.<String>undefined();

public DefaultValue() {
}

public DefaultValue arrayStringEnumRefDefault(List<StringEnumRef> arrayStringEnumRefDefault) {
public DefaultValue arrayStringEnumRefDefault(@javax.annotation.Nullable List<StringEnumRef> arrayStringEnumRefDefault) {

this.arrayStringEnumRefDefault = arrayStringEnumRefDefault;
return this;
Expand Down Expand Up @@ -142,11 +150,11 @@ public List<StringEnumRef> getArrayStringEnumRefDefault() {

@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setArrayStringEnumRefDefault(List<StringEnumRef> arrayStringEnumRefDefault) {
public void setArrayStringEnumRefDefault(@javax.annotation.Nullable List<StringEnumRef> arrayStringEnumRefDefault) {
this.arrayStringEnumRefDefault = arrayStringEnumRefDefault;
}

public DefaultValue arrayStringEnumDefault(List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault) {
public DefaultValue arrayStringEnumDefault(@javax.annotation.Nullable List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault) {

this.arrayStringEnumDefault = arrayStringEnumDefault;
return this;
Expand Down Expand Up @@ -175,11 +183,11 @@ public List<ArrayStringEnumDefaultEnum> getArrayStringEnumDefault() {

@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setArrayStringEnumDefault(List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault) {
public void setArrayStringEnumDefault(@javax.annotation.Nullable List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault) {
this.arrayStringEnumDefault = arrayStringEnumDefault;
}

public DefaultValue arrayStringDefault(List<String> arrayStringDefault) {
public DefaultValue arrayStringDefault(@javax.annotation.Nullable List<String> arrayStringDefault) {

this.arrayStringDefault = arrayStringDefault;
return this;
Expand Down Expand Up @@ -208,11 +216,11 @@ public List<String> getArrayStringDefault() {

@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setArrayStringDefault(List<String> arrayStringDefault) {
public void setArrayStringDefault(@javax.annotation.Nullable List<String> arrayStringDefault) {
this.arrayStringDefault = arrayStringDefault;
}

public DefaultValue arrayIntegerDefault(List<Integer> arrayIntegerDefault) {
public DefaultValue arrayIntegerDefault(@javax.annotation.Nullable List<Integer> arrayIntegerDefault) {

this.arrayIntegerDefault = arrayIntegerDefault;
return this;
Expand Down Expand Up @@ -241,11 +249,11 @@ public List<Integer> getArrayIntegerDefault() {

@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setArrayIntegerDefault(List<Integer> arrayIntegerDefault) {
public void setArrayIntegerDefault(@javax.annotation.Nullable List<Integer> arrayIntegerDefault) {
this.arrayIntegerDefault = arrayIntegerDefault;
}

public DefaultValue arrayString(List<String> arrayString) {
public DefaultValue arrayString(@javax.annotation.Nullable List<String> arrayString) {

this.arrayString = arrayString;
return this;
Expand Down Expand Up @@ -274,11 +282,11 @@ public List<String> getArrayString() {

@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setArrayString(List<String> arrayString) {
public void setArrayString(@javax.annotation.Nullable List<String> arrayString) {
this.arrayString = arrayString;
}

public DefaultValue arrayStringNullable(List<String> arrayStringNullable) {
public DefaultValue arrayStringNullable(@javax.annotation.Nullable List<String> arrayStringNullable) {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);

return this;
Expand Down Expand Up @@ -319,11 +327,11 @@ public void setArrayStringNullable_JsonNullable(JsonNullable<List<String>> array
this.arrayStringNullable = arrayStringNullable;
}

public void setArrayStringNullable(List<String> arrayStringNullable) {
public void setArrayStringNullable(@javax.annotation.Nullable List<String> arrayStringNullable) {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);
}

public DefaultValue arrayStringExtensionNullable(List<String> arrayStringExtensionNullable) {
public DefaultValue arrayStringExtensionNullable(@javax.annotation.Nullable List<String> arrayStringExtensionNullable) {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);

return this;
Expand Down Expand Up @@ -364,11 +372,11 @@ public void setArrayStringExtensionNullable_JsonNullable(JsonNullable<List<Strin
this.arrayStringExtensionNullable = arrayStringExtensionNullable;
}

public void setArrayStringExtensionNullable(List<String> arrayStringExtensionNullable) {
public void setArrayStringExtensionNullable(@javax.annotation.Nullable List<String> arrayStringExtensionNullable) {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);
}

public DefaultValue stringNullable(String stringNullable) {
public DefaultValue stringNullable(@javax.annotation.Nullable String stringNullable) {
this.stringNullable = JsonNullable.<String>of(stringNullable);

return this;
Expand Down Expand Up @@ -397,7 +405,7 @@ public void setStringNullable_JsonNullable(JsonNullable<String> stringNullable)
this.stringNullable = stringNullable;
}

public void setStringNullable(String stringNullable) {
public void setStringNullable(@javax.annotation.Nullable String stringNullable) {
this.stringNullable = JsonNullable.<String>of(stringNullable);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
public class NumberPropertiesOnly {
public static final String JSON_PROPERTY_NUMBER = "number";
@javax.annotation.Nullable
private BigDecimal number;

public static final String JSON_PROPERTY_FLOAT = "float";
@javax.annotation.Nullable
private Float _float;

public static final String JSON_PROPERTY_DOUBLE = "double";
@javax.annotation.Nullable
private Double _double;

public NumberPropertiesOnly() {
}

public NumberPropertiesOnly number(BigDecimal number) {
public NumberPropertiesOnly number(@javax.annotation.Nullable BigDecimal number) {

this.number = number;
return this;
Expand All @@ -70,11 +73,11 @@ public BigDecimal getNumber() {

@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setNumber(BigDecimal number) {
public void setNumber(@javax.annotation.Nullable BigDecimal number) {
this.number = number;
}

public NumberPropertiesOnly _float(Float _float) {
public NumberPropertiesOnly _float(@javax.annotation.Nullable Float _float) {

this._float = _float;
return this;
Expand All @@ -95,11 +98,11 @@ public Float getFloat() {

@JsonProperty(JSON_PROPERTY_FLOAT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setFloat(Float _float) {
public void setFloat(@javax.annotation.Nullable Float _float) {
this._float = _float;
}

public NumberPropertiesOnly _double(Double _double) {
public NumberPropertiesOnly _double(@javax.annotation.Nullable Double _double) {

this._double = _double;
return this;
Expand All @@ -122,7 +125,7 @@ public Double getDouble() {

@JsonProperty(JSON_PROPERTY_DOUBLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDouble(Double _double) {
public void setDouble(@javax.annotation.Nullable Double _double) {
this._double = _double;
}

Expand Down
Loading

0 comments on commit b723dd9

Please sign in to comment.