swagger-api / swagger-api/swagger-codegen

[JAVA] Retrofit codegen

Open
#8,568 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

How is it possible to declare with openapi specification an endpoint that it generates this java Retrofit2 code:

@GET("pet/{pet}/document")
Call<ResponseBody> document();

By specifying ResponseBody as return type Retrofit will not try to parse and convert the response. This is useful when the response is a file.

For large files there should be also the @streaming annotation.

Thank you

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

Start with the OpenAPI specification and compare the generated Retrofit2 method with the requested ResponseBody return type and streaming annotation. Identify the codegen entry point or template responsible for Retrofit2 methods, then verify that a specification can produce both the file response handling and streaming behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.