Skip to content

Commit e20af77

Browse files
siilatswing328
authored andcommitted
Implement BigDecimal to Decimal in swift4 for currency data as type=string format=number (#3910)
1 parent 8408232 commit e20af77

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ public DefaultCodegen() {
10681068
typeMapping.put("file", "File");
10691069
typeMapping.put("UUID", "UUID");
10701070
typeMapping.put("URI", "URI");
1071-
//typeMapping.put("BigDecimal", "BigDecimal"); //TODO need the mapping?
1071+
typeMapping.put("BigDecimal", "BigDecimal"); //TODO need the mapping?
10721072

10731073

10741074
instantiationTypes = new HashMap<String, String>();

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public Swift4Codegen() {
101101
"UUID",
102102
"URL",
103103
"AnyObject",
104-
"Any")
104+
"Any",
105+
"Decimal")
105106
);
106107
defaultIncludes = new HashSet<>(
107108
Arrays.asList(
@@ -115,7 +116,8 @@ public Swift4Codegen() {
115116
"Any",
116117
"Empty",
117118
"AnyObject",
118-
"Any")
119+
"Any",
120+
"Decimal")
119121
);
120122

121123
objcReservedWords = new HashSet<>(
@@ -198,6 +200,7 @@ public Swift4Codegen() {
198200
typeMapping.put("ByteArray", "Data");
199201
typeMapping.put("UUID", "UUID");
200202
typeMapping.put("URI", "String");
203+
typeMapping.put("BigDecimal", "Decimal");
201204

202205
importMapping = new HashMap<>();
203206

0 commit comments

Comments
 (0)