mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
fix bigdecimal in default codegen
This commit is contained in:
parent
ffa0e115d9
commit
9d1ae0dd29
@ -1139,7 +1139,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
} else if (SchemaTypeUtil.DOUBLE_FORMAT.equals(schema.getFormat())) {
|
} else if (SchemaTypeUtil.DOUBLE_FORMAT.equals(schema.getFormat())) {
|
||||||
datatype = SchemaTypeUtil.DOUBLE_FORMAT;
|
datatype = SchemaTypeUtil.DOUBLE_FORMAT;
|
||||||
} else { // without format
|
} else { // without format
|
||||||
datatype = "BigDecimal";
|
datatype = schema.getType(); // number
|
||||||
}
|
}
|
||||||
} else if (schema instanceof IntegerSchema || SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType())) {
|
} else if (schema instanceof IntegerSchema || SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType())) {
|
||||||
if (SchemaTypeUtil.INTEGER64_FORMAT.equals(schema.getFormat())) {
|
if (SchemaTypeUtil.INTEGER64_FORMAT.equals(schema.getFormat())) {
|
||||||
@ -4155,7 +4155,8 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
codegenProperty = codegenProperty.items;
|
codegenProperty = codegenProperty.items;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGGER.warn("Scheme type " + schema.getType() + "not handled in reqeust body");
|
// TODO need to handle primitive type in this block
|
||||||
|
LOGGER.warn("Scheme type " + schema.getType() + " not handled in reqeust body");
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the parameter's example value
|
// set the parameter's example value
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**array_array_number** | **Array<Array<BigDecimal>>** | | [optional]
|
**array_array_number** | **Array<Array<Float>>** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**array_number** | [**Array<BigDecimal>**](BigDecimal.md) | | [optional]
|
**array_number** | **Array<Float>** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ Name | Type | Description | Notes
|
|||||||
**integer** | **Integer** | | [optional]
|
**integer** | **Integer** | | [optional]
|
||||||
**int32** | **Integer** | | [optional]
|
**int32** | **Integer** | | [optional]
|
||||||
**int64** | **Integer** | | [optional]
|
**int64** | **Integer** | | [optional]
|
||||||
**number** | [**BigDecimal**](BigDecimal.md) | |
|
**number** | **Float** | |
|
||||||
**float** | **Float** | | [optional]
|
**float** | **Float** | | [optional]
|
||||||
**double** | **Float** | | [optional]
|
**double** | **Float** | | [optional]
|
||||||
**string** | **String** | | [optional]
|
**string** | **String** | | [optional]
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**just_number** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
**just_number** | **Float** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ module Petstore
|
|||||||
# Attribute type mapping.
|
# Attribute type mapping.
|
||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'array_array_number' => :'Array<Array<BigDecimal>>'
|
:'array_array_number' => :'Array<Array<Float>>'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ module Petstore
|
|||||||
# Attribute type mapping.
|
# Attribute type mapping.
|
||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'array_number' => :'Array<BigDecimal>'
|
:'array_number' => :'Array<Float>'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ module Petstore
|
|||||||
:'integer' => :'Integer',
|
:'integer' => :'Integer',
|
||||||
:'int32' => :'Integer',
|
:'int32' => :'Integer',
|
||||||
:'int64' => :'Integer',
|
:'int64' => :'Integer',
|
||||||
:'number' => :'BigDecimal',
|
:'number' => :'Float',
|
||||||
:'float' => :'Float',
|
:'float' => :'Float',
|
||||||
:'double' => :'Float',
|
:'double' => :'Float',
|
||||||
:'string' => :'String',
|
:'string' => :'String',
|
||||||
|
@ -26,7 +26,7 @@ module Petstore
|
|||||||
# Attribute type mapping.
|
# Attribute type mapping.
|
||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'just_number' => :'BigDecimal'
|
:'just_number' => :'Float'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user