Skip to content

[Swfit4] better support for type=string, format=number #3910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ public DefaultCodegen() {
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?
Copy link
Member

@wing328 wing328 Sep 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siilats why do you need to uncomment the mapping in the default codegen as it's already done in Swfit4Codegen:

as part of this PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove this, I'm happy to merge the PR and discuss the mapping of BigDecimal in the default codegen if needed.



instantiationTypes = new HashMap<String, String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public Swift4Codegen() {
"UUID",
"URL",
"AnyObject",
"Any")
"Any",
"Decimal")
);
defaultIncludes = new HashSet<>(
Arrays.asList(
Expand All @@ -115,7 +116,8 @@ public Swift4Codegen() {
"Any",
"Empty",
"AnyObject",
"Any")
"Any",
"Decimal")
);

objcReservedWords = new HashSet<>(
Expand Down Expand Up @@ -198,6 +200,7 @@ public Swift4Codegen() {
typeMapping.put("ByteArray", "Data");
typeMapping.put("UUID", "UUID");
typeMapping.put("URI", "String");
typeMapping.put("BigDecimal", "Decimal");

importMapping = new HashMap<>();

Expand Down