mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-18 02:19:21 +00:00
Fix Bug 1433 decimal literal in C# maybe other languages (#1436)
* Trivial change to kick PR again * Fix issue 1433 (default decimal literal broken for C#) * Replace tab with space * update samples
This commit is contained in:
committed by
William Cheng
parent
302922b8a4
commit
f76dca84f5
@@ -804,7 +804,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
IOUtils.copy(in, out);
|
||||
out.close();
|
||||
} else {
|
||||
LOGGER.error("can't open '" + templateFile + "' for input, can not write '" + filename + "'");
|
||||
LOGGER.error("can't open '" + templateFile + "' for input; cannot write '" + filename + "'");
|
||||
}
|
||||
return outputFile;
|
||||
}
|
||||
|
||||
@@ -775,8 +775,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
return p.getDefault().toString() + "F";
|
||||
} else if (ModelUtils.isDoubleSchema(p)) { // double
|
||||
return p.getDefault().toString() + "D";
|
||||
} else {
|
||||
return p.getDefault().toString();
|
||||
} else { // decimal
|
||||
return p.getDefault().toString() + "M";
|
||||
}
|
||||
}
|
||||
} else if (ModelUtils.isIntegerSchema(p)) {
|
||||
|
||||
@@ -401,9 +401,6 @@ public class ModelUtils {
|
||||
}
|
||||
|
||||
public static boolean isDoubleSchema(Schema schema) {
|
||||
if (schema instanceof NumberSchema) {
|
||||
return true;
|
||||
}
|
||||
if (SchemaTypeUtil.NUMBER_TYPE.equals(schema.getType())
|
||||
&& SchemaTypeUtil.DOUBLE_FORMAT.equals(schema.getFormat())) { // format: double
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user