swagger-api / swagger-api/swagger-codegen
[Java] Retrofit2-rx settings
Open
Nobody has claimed this yet.
Client: Retrofit
General: Question
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I'm not able to figure out how to set settings like endpoint url into generated ApiClient.
Up to now, I've used this code:
ApiClient apiClient = new ApiClient(); <<<<<<<???????????
apiClient.addAuthorization("", new LivingOAuthInterceptor());
ClientApi clientAPI = apiClient.createService(ClientApi.class);
Observable<Void> s = clientAPI.deleteReferenceToken("refToken");
s.subscribe();
Swagger-codegen version
2.3.0 (built from last 2.3.0 branch commit)
Command line used for generation
PS D:\projects\living\references\swagger_codegen\bin\windows> java -jar D:\projects\living\references\swagger_codegen\mo
dules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://guest1:8080/authz/cmng/swagger.json -l java
-o authz\java -c config.json
where config.json is:
{
"library": "retrofit2",
"artifactId": "swagger-authz-retrofit2-rx",
"modelPackage": "com.living.authz.client.model",
"apiPackage": "com.living.authz.client.api",
"useRxJava2": true,
"hideGenerationTimestamp": true
}
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 inspecting the generated ApiClient and the retrofit2 configuration in config.json, using the shown generation command as the entry point. Determine how the endpoint URL is expected to be configured and whether the generated client supports it; done means the configuration path is established or the missing behavior is clearly reproduced.
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
- Needs clarification
- Newbie friendliness
- 25/100