forked from loafle/openapi-generator-original
Fix float default value
Decimal literals for floats must be casted to float, because that are doubles by default
This commit is contained in:
parent
3147061345
commit
1b16d87dd5
@ -299,11 +299,16 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
for (CodegenProperty var : cm.vars) {
|
for (CodegenProperty var : cm.vars) {
|
||||||
Map<String, Object> allowableValues = var.allowableValues;
|
Map<String, Object> allowableValues = var.allowableValues;
|
||||||
|
|
||||||
|
//handle float defaults
|
||||||
|
if((var.defaultValue != null) && (var.datatype.startsWith("float"))) {
|
||||||
|
var.defaultValue = String.format("%1$sF", var.defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
// handle ArrayProperty
|
// handle ArrayProperty
|
||||||
if (var.items != null) {
|
if (var.items != null) {
|
||||||
allowableValues = var.items.allowableValues;
|
allowableValues = var.items.allowableValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowableValues == null) {
|
if (allowableValues == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user