c# client float default value

better solution
This commit is contained in:
mmschettler
2016-03-16 22:42:05 +01:00
parent 1b16d87dd5
commit 4594c53c81
2 changed files with 1 additions and 6 deletions

View File

@@ -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;

View File

@@ -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) {