[fix] Add Accept header to Retrofit clients #92
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR
The conjure spec states that:
Feign clients created using conjure-java-runtime correctly implement the spec because Feign reads the JAX-RS annotations to set the
Accept
andContent-Type
headers.Retrofit clients created using conjure-java-runtime do not set either the
Accept
orContent-Type
headers. TheContent-Type
header does exist on requests from Retrofit clients only because it is set by OkHttp.After this PR
This PR adds the necessary annotations so requests from conjure-java-runtime Retrofit clients include the correct
Accept
header.This implementation deviates slightly from a literal interpretation of the conjure spec and does not set the
Accept
header for requests that return void. If this was the intention when writing the conjure spec, it should be updated to make this clear. Otherwise, we should modify this PR.