palantir / palantir/conjure-java-runtime
Retrofit clients use the wrong Content-Type for JSON
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 95
- Forks
- 96
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 33
Description
What happened?
A Retrofit-based client created via Retrofit2Client.create will send Content-Type: application/json; charset=UTF-8 as a header.
What did you want to happen?
The client should send Content-Type: application/json as specified in the Conjure spec: https://github.com/palantir/conjure/blob/master/docs/spec/wire.md#241-content-type-header
The content-type is set by Retrofit's JacksonRequestBodyConverter, so we'd probably need to make our own version.
Contributor guide
No contributing guide indexed for this repository
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 at Retrofit2Client.create and inspect how Retrofit's JacksonRequestBodyConverter sets the JSON Content-Type. Compare the emitted header with the Conjure wire specification, then verify that the client sends application/json without the charset parameter. The issue does not name a test file, so locate the existing Retrofit client request tests before making changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100