forked from loafle/openapi-generator-original
[Java][okhttp-gson] fix failure to deserialize floats (#3846)
* fixed bug where nullApi.java would be generated. Instead, generated DefaultApi.java to match the default path /{pathParam}
* fix to bug #3157
* update samples
This commit is contained in:
committed by
William Cheng
parent
5fd15b8b18
commit
239d68df36
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | |
|
||||
**numberItem** | [**BigDecimal**](BigDecimal.md) | |
|
||||
**floatItem** | **Float** | |
|
||||
**integerItem** | **Integer** | |
|
||||
**boolItem** | **Boolean** | |
|
||||
**arrayItem** | **List<Integer>** | |
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@JsonPropertyOrder({
|
||||
TypeHolderExample.JSON_PROPERTY_STRING_ITEM,
|
||||
TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM,
|
||||
TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM,
|
||||
TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM,
|
||||
TypeHolderExample.JSON_PROPERTY_BOOL_ITEM,
|
||||
TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM
|
||||
@@ -44,6 +45,9 @@ public class TypeHolderExample {
|
||||
public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item";
|
||||
private BigDecimal numberItem;
|
||||
|
||||
public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item";
|
||||
private Float floatItem;
|
||||
|
||||
public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item";
|
||||
private Integer integerItem;
|
||||
|
||||
@@ -104,6 +108,31 @@ public class TypeHolderExample {
|
||||
}
|
||||
|
||||
|
||||
public TypeHolderExample floatItem(Float floatItem) {
|
||||
|
||||
this.floatItem = floatItem;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get floatItem
|
||||
* @return floatItem
|
||||
**/
|
||||
@ApiModelProperty(example = "1.234", required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FLOAT_ITEM)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public Float getFloatItem() {
|
||||
return floatItem;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setFloatItem(Float floatItem) {
|
||||
this.floatItem = floatItem;
|
||||
}
|
||||
|
||||
|
||||
public TypeHolderExample integerItem(Integer integerItem) {
|
||||
|
||||
this.integerItem = integerItem;
|
||||
@@ -195,6 +224,7 @@ public class TypeHolderExample {
|
||||
TypeHolderExample typeHolderExample = (TypeHolderExample) o;
|
||||
return Objects.equals(this.stringItem, typeHolderExample.stringItem) &&
|
||||
Objects.equals(this.numberItem, typeHolderExample.numberItem) &&
|
||||
Objects.equals(this.floatItem, typeHolderExample.floatItem) &&
|
||||
Objects.equals(this.integerItem, typeHolderExample.integerItem) &&
|
||||
Objects.equals(this.boolItem, typeHolderExample.boolItem) &&
|
||||
Objects.equals(this.arrayItem, typeHolderExample.arrayItem);
|
||||
@@ -202,7 +232,7 @@ public class TypeHolderExample {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem);
|
||||
return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -212,6 +242,7 @@ public class TypeHolderExample {
|
||||
sb.append("class TypeHolderExample {\n");
|
||||
sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n");
|
||||
sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n");
|
||||
sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n");
|
||||
sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n");
|
||||
sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n");
|
||||
sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n");
|
||||
|
||||
Reference in New Issue
Block a user