forked from loafle/openapi-generator-original
c# client float default value
better solution
This commit is contained in:
@@ -435,7 +435,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
} else if (p instanceof FloatProperty) {
|
||||
FloatProperty dp = (FloatProperty) p;
|
||||
if (dp.getDefault() != null) {
|
||||
return dp.getDefault().toString();
|
||||
return String.format("%1$sF", dp.getDefault());
|
||||
}
|
||||
} else if (p instanceof IntegerProperty) {
|
||||
IntegerProperty dp = (IntegerProperty) p;
|
||||
|
||||
@@ -298,11 +298,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||
for (CodegenProperty var : cm.vars) {
|
||||
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
|
||||
if (var.items != null) {
|
||||
|
||||
Reference in New Issue
Block a user