-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Java RESTEasy client does not provide the "filename" directive when creating "multipart/form-data" requests #17367
Comments
@miladhub thanks for reporting the issue. Can you please file a PR with the suggested fix? |
Yes I can look into that. |
I tried to push the fix on a branch to then create a PR, but the push is getting refused: $ git push --set-upstream origin pr_17367_multipart_filenames
remote: Permission to OpenAPITools/openapi-generator.git denied to miladhub.
fatal: unable to access 'https://github.com/OpenAPITools/openapi-generator.git/': The requested URL returned error: 403 |
I've also tried with SSH and signed commits, but I still get an unauthorized error. Attaching patch. |
For the record, I've tried this exact process on a repo of my own and it works, so it must really be a matter of permissions. Let me know if I can do anything, but feel free to use my patch, thanks. |
please refer to https://github.com/OpenAPITools/openapi-generator/wiki/faq#how-can-i-submit-a-pr-to-fix-bugs-or-make-enhancements on how to file a PR |
Thanks! Created PR: #17435 |
Verified end-to-end against version 7.2.0. |
Description
When generating a Java RESTEasy client for an API that creates "multipart/form-data" requests, the HTTP request lacks the "filename" directive. The generated code seems to simply omit the parameter - i.e., instead of calling this API, it calls this one. Note that the generated code has the
file
at hand, so it is entirely within its reach to provide it.openapi-generator version
7.2.0-SNAPSHOT
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Main
class with the following contentsmvn clean install
nc localhost -l 8080 | grep "Content-Disposition"
mvn exec:java -Dexec.mainClass="org.openapitools.client.Main"
The tab open at point 4 should display the following:
showing that the "filename" directive is missing. The output should have been
Note - The last command needs to be eventually killed.
Related issues/PRs
Found none.
Suggest a fix/enhancement
The fix should be a matter of adding
, file.getName()
on this line of generated code:The text was updated successfully, but these errors were encountered: