Skip to content
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

[swift5] Map file and binary to Data #9419

Merged

Conversation

aymanbagabas
Copy link
Contributor

Fixes: #9308

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@@ -115,7 +115,6 @@ public Swift5ClientCodegen() {
"Bool",
"Void",
"String",
"URL",
Copy link
Contributor

Choose a reason for hiding this comment

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

@aymanbagabas why are you reming URL from the list of primitive types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is duplicated in line 123

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right 👍

@@ -219,8 +218,8 @@ public Swift5ClientCodegen() {
typeMapping.put("float", "Float");
typeMapping.put("number", "Double");
typeMapping.put("double", "Double");
typeMapping.put("file", "URL");
Copy link
Contributor

Choose a reason for hiding this comment

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

@aymanbagabas could you please introduce a flag to control the typeMapping to be URL or Data, depending on this flag?
Because we need to give an option to the users to set the old behaviour if they need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is more of a "bug fix" than a new feature.

Copy link
Contributor

@4brunu 4brunu May 10, 2021

Choose a reason for hiding this comment

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

The problem is that this is a big change that can impact users.
From what we discuss in the issue, the file download is not working, bit the file upload is working as expected, and this can potentially break it.
So I think it's a good ideia to give an option to keep the old behaviour in case the users found any issue with this change.

@aymanbagabas aymanbagabas force-pushed the swift5-map-file-binary-to-data branch from 2ef0df8 to 521776f Compare May 7, 2021 19:07
@4brunu
Copy link
Contributor

4brunu commented May 18, 2021

@aymanbagabas I was reviewing the open PRs and saw this one.
Would you mind creating a flag to control the Data or URL usage, to allow the users to set the old behaviour if they need it?
If you don't have the time I can try to do it 🙂

@aymanbagabas
Copy link
Contributor Author

@aymanbagabas I was reviewing the open PRs and saw this one.
Would you mind creating a flag to control the Data or URL usage, to allow the users to set the old behaviour if they need it?
If you don't have the time I can try to do it 🙂

Go ahead, I'm kinda busy nowadays and would really appreciate it

@aymanbagabas aymanbagabas force-pushed the swift5-map-file-binary-to-data branch 3 times, most recently from 521776f to 3918f3d Compare May 25, 2021 14:23
@aymanbagabas aymanbagabas force-pushed the swift5-map-file-binary-to-data branch from 3918f3d to 9ea1bd6 Compare May 25, 2021 14:39
@aymanbagabas aymanbagabas force-pushed the swift5-map-file-binary-to-data branch from b81b8f4 to 4822a5a Compare May 25, 2021 14:57
@aymanbagabas
Copy link
Contributor Author

@4brunu I think the docs CI is failing due to a missing generator not related to this PR. Travis CI couldn't pull the docker image and thus is failing.

@4brunu
Copy link
Contributor

4brunu commented May 25, 2021

@4brunu I think the docs CI is failing due to a missing generator not related to this PR. Travis CI couldn't pull the docker image and thus is failing.

@aymanbagabas I think you are right, let's way for the other CI's to see if they pass

@aymanbagabas aymanbagabas mentioned this pull request May 25, 2021
6 tasks
@wing328 wing328 added this to the 5.2.0 milestone May 26, 2021
@wing328 wing328 merged commit ae03502 into OpenAPITools:master May 26, 2021
premiumitsolution pushed a commit to premiumitsolution/openapi-generator that referenced this pull request May 26, 2021
* [swift5] Map file and binary to Data

Fixes: OpenAPITools#9308

* Update docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swift5: Binary / File type generated incorrectly as URL in responses
3 participants