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:
john lilley
2019-02-10 00:28:40 -07:00
committed by William Cheng
parent 302922b8a4
commit f76dca84f5
21 changed files with 21 additions and 24 deletions

View File

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

View File

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

View File

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