swagger-api / swagger-api/swagger-codegen

[JAVA][Retrofit2] How to use auto-generated client code?

Open
#7,266 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Java Client: Retrofit Feature: Documentation Issue: Non-operational
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Swagger generates instructions how to use auto-generated client code:
Eg. https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/java/retrofit2/docs/PetApi.md
However, Configuration and ApiException used in the example code don't exist in the generated sources.
So, how to use it?

Swagger-codegen version

2.3.0

Command line used for generation

I'm using gradle plugin.

Steps to reproduce

Generate java code using Retrofit2 library from PetStore API example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the generated Retrofit2 PetStore sources with the referenced samples/client/petstore/java/retrofit2/docs/PetApi.md instructions. Reproduce generation through the Gradle plugin, then inspect where Configuration and ApiException are referenced or expected; done means the generated sources and usage instructions agree and the example can be followed.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.