mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 15:10:49 +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) {
|
||||
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,12 +298,12 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||
for (CodegenProperty var : cm.vars) {
|
||||
Map<String, Object> allowableValues = var.allowableValues;
|
||||
|
||||
|
||||
// handle ArrayProperty
|
||||
if (var.items != null) {
|
||||
allowableValues = var.items.allowableValues;
|
||||
}
|
||||
|
||||
|
||||
if (allowableValues == null) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user