mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 23:20:52 +00:00
Merge pull request #2397 from mmschettler/master
Fix c# client float property default values
This commit is contained in:
commit
ccd4a78514
@ -435,7 +435,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
|||||||
} else if (p instanceof FloatProperty) {
|
} else if (p instanceof FloatProperty) {
|
||||||
FloatProperty dp = (FloatProperty) p;
|
FloatProperty dp = (FloatProperty) p;
|
||||||
if (dp.getDefault() != null) {
|
if (dp.getDefault() != null) {
|
||||||
return dp.getDefault().toString();
|
return String.format("%1$sF", dp.getDefault());
|
||||||
}
|
}
|
||||||
} else if (p instanceof IntegerProperty) {
|
} else if (p instanceof IntegerProperty) {
|
||||||
IntegerProperty dp = (IntegerProperty) p;
|
IntegerProperty dp = (IntegerProperty) p;
|
||||||
|
@ -298,12 +298,12 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||||
for (CodegenProperty var : cm.vars) {
|
for (CodegenProperty var : cm.vars) {
|
||||||
Map<String, Object> allowableValues = var.allowableValues;
|
Map<String, Object> allowableValues = var.allowableValues;
|
||||||
|
|
||||||
// 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