Implement BigDecimal to Decimal in swift4 for currency data as type=string format=number (#3910)

This commit is contained in:
keith siilats
2019-09-25 10:43:51 -04:00
committed by William Cheng
parent 8408232d1a
commit e20af77944
2 changed files with 6 additions and 3 deletions

View File

@@ -1068,7 +1068,7 @@ public class DefaultCodegen implements CodegenConfig {
typeMapping.put("file", "File");
typeMapping.put("UUID", "UUID");
typeMapping.put("URI", "URI");
//typeMapping.put("BigDecimal", "BigDecimal"); //TODO need the mapping?
typeMapping.put("BigDecimal", "BigDecimal"); //TODO need the mapping?
instantiationTypes = new HashMap<String, String>();

View File

@@ -101,7 +101,8 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
"UUID",
"URL",
"AnyObject",
"Any")
"Any",
"Decimal")
);
defaultIncludes = new HashSet<>(
Arrays.asList(
@@ -115,7 +116,8 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
"Any",
"Empty",
"AnyObject",
"Any")
"Any",
"Decimal")
);
objcReservedWords = new HashSet<>(
@@ -198,6 +200,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
typeMapping.put("ByteArray", "Data");
typeMapping.put("UUID", "UUID");
typeMapping.put("URI", "String");
typeMapping.put("BigDecimal", "Decimal");
importMapping = new HashMap<>();