OpenAPITools / OpenAPITools/openapi-generator
[BUG][Java][native] Client - wrong Content-Type, double-quoted payload
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue?
https://github.com/cjc343/wrapped-string -
Have you validated the input using an OpenAPI validator (example)?
-
What's the version of OpenAPI Generator used?
4.1.0 -
Have you search for related issues/PRs?
Possibly: #3672 -
What's the actual output vs expected output?
Given a payload oftest, the body generated by the client:
Actual:"test"
Expected:testGiven a content definition of
text/csv, the Content-Type header:
Actual:application/json
Expected:text/csv
Description
- Content-Type header does not match API definition
- Payload is malformed
openapi-generator version
4.1.0, not a regression, first version to support java 11 native client
OpenAPI declaration file content or url
https://github.com/cjc343/wrapped-string/blob/master/src/main/resources/api.yml
Command line used for generation
mvn package
Steps to reproduce
- Run the tests in the sample project
Related issues/PRs
Possibly: #3672
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sample project's API declaration at src/main/resources/api.yml and run its tests with mvn package. Compare the generated Java native client's request body and Content-Type for the test payload and text/csv definition with the expected values. Done means the sample tests show an unquoted payload and the declared Content-Type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100