swagger-api / swagger-api/swagger-codegen
[Retrofit2 + Play! WS client ] Add headers
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I am not able to set custom headers from the ApiClient class.
Swagger-codegen version
2.3.0-SNAPSHOT
Suggest a fix/enhancement
Wouldn't be a good idea to have something like this?
Map<String, List<String>> headers = new HashMap<>();
//fill the map with your headers
ApiClient generatedClient = new ApiClient(client)
.setBasePath(basePath)
.setHeaders(headers);
BalanceApi api = generatedClient.createService(BalanceApi.class);
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 by locating the Java ApiClient implementation used with Retrofit2 and Play WS, then trace createService and how request headers are assembled. Check any generated-client tests or examples; done means a caller can provide a map of custom headers through ApiClient and those headers reach requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100