forked from loafle/openapi-generator-original
[Java] fix default value for JsonNullable (#14703)
* fix java webclient default value * update default value in java okhttp client * fix java native client default value in JsonNullable * improve java okhttp-gson default value template * update java rest-related templates * update feign samples * update jersey3 templates * update jersey2 templates * update default value in jaxrs templates * fix spring default value * update jaxrs pojo, fix tests * update samples * suport set
This commit is contained in:
@@ -308,7 +308,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
|
||||
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
|
||||
if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) {
|
||||
this.arrayNullableProp = JsonNullable.<List<Object>>of(null);
|
||||
this.arrayNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
|
||||
}
|
||||
try {
|
||||
this.arrayNullableProp.get().add(arrayNullablePropItem);
|
||||
@@ -354,7 +354,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
|
||||
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
|
||||
if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) {
|
||||
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(null);
|
||||
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
|
||||
}
|
||||
try {
|
||||
this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem);
|
||||
@@ -434,7 +434,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
|
||||
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
|
||||
if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) {
|
||||
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(null);
|
||||
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
|
||||
}
|
||||
try {
|
||||
this.objectNullableProp.get().put(key, objectNullablePropItem);
|
||||
@@ -480,7 +480,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
|
||||
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
|
||||
if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) {
|
||||
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(null);
|
||||
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
|
||||
}
|
||||
try {
|
||||
this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem);
|
||||
|
||||
Reference in New Issue
Block a user