Open 40rn05lyv opened 4 years ago
@40rn05lyv thanks for reporting the issue. Please file a PR so that we can review more easily.
@40rn05lyv Hello, I am working on this issue. Can you please clarify how to reproduce this issue? Thank you.
@S2021Git
@40rn05lyv thank you for the response. Below are the steps I did but I got an error message, what did I do wrong here?
What should I do here?
@40rn05lyv Hi, just checking to see if you saw the message I posted above. Thank you!
@S2021Git Sorry, I don't have time for this. I already suggested a fix in my first message here, and it's working in my own private fork.
Description
I use Jersey2 as generator for my REST, including DELETE operations that don't "accept" any body. As a result, I see that the generated code executes HTTP requests with header "Accept:null" that is not a valid header (because of "null" string).
openapi-generator version
I use openapi-generator-maven-plugin 4.2.3, but from what I see in source code this bug should be reproducible in the master too.
OpenAPI declaration file content or url
Command line used for generation
pom.xml config:
Steps to reproduce
See description, it's quite obvious.
Related issues/PRs
Not found
Suggest a fix
In file
openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
change line fromInvocation.Builder invocationBuilder = target.request().accept(accept);
to
Invocation.Builder invocationBuilder = accept != null ? target.request().accept(accept) : target.request();
Also, need to check other generator for this problem.