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

[dart][dart-dio-next] Improve support for file uploads #9542

Merged
merged 6 commits into from May 25, 2021

Conversation

kuhnroyal
Copy link
Contributor

@jaumard @ayushin This should fix your linked issues.

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.

CC @swipesight (2018/09) @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12)

* add support for filenames in multipart requests by using  `MultipartFile` from dio directly
* add support for binary/file body data
* fixes OpenAPITools#6671
* fixes OpenAPITools#9079
@ayushin
Copy link
Contributor

ayushin commented May 21, 2021

Finally, very much needed.

@@ -36,7 +36,7 @@ void main() {
'int64': '9223372036854775807',
'date': '2020-08-11',
'dateTime': '2020-08-11T12:30:55.123Z',
'binary': "Instance of 'MultipartFile'",
'binary': '[0, 1, 2, 3, 4, 5]',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure this makes sense to send over the wire like this, but better than before in any case.

@wing328
Copy link
Member

wing328 commented May 24, 2021

@kuhnroyal please resolve the merge conflicts when you've time. Thanks.

@wing328
Copy link
Member

wing328 commented May 25, 2021

CI failure not related to this change.

@wing328 wing328 merged commit ab11acd into OpenAPITools:master May 25, 2021
@kuhnroyal kuhnroyal deleted the dart-dio/file-support branch May 25, 2021 16:16
premiumitsolution pushed a commit to premiumitsolution/openapi-generator that referenced this pull request May 26, 2021
…9542)

* [dart][dart-dio] Improve support for file uploads

* add support for filenames in multipart requests by using  `MultipartFile` from dio directly
* add support for binary/file body data
* fixes OpenAPITools#6671
* fixes OpenAPITools#9079

* Add and fix tests

* Only use MultipartFile for body/multipart parameters

* Fix test

* Actually fix tests
@bbqtk
Copy link

bbqtk commented Jul 14, 2021

I am currently using 5.2.0, but I found that the change to support MultipartFile does not seem to take effect at all. I checked the generated template and found that there was no change at all!!!

@bbqtk
Copy link

bbqtk commented Jul 14, 2021

@wing328 @ayushin Is it caused by my mistakes, do I need to make other changes, besides upgrading to 5.2.0

@bbqtk
Copy link

bbqtk commented Jul 14, 2021

dart-dio-next

@kuhnroyal
Copy link
Contributor Author

This should work with dart-dio-next, there may be a problem with nullable files.

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.

[DART-dio] Can't send body and binary data [dart-dio] multi-part file should accept filename
6 participants