swagger-api / swagger-api/swagger-core

Representing "204 No Content" with jax-rs

Open
#4,693 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

I'm trying to do something like this:

@GET
@Path("/foo")
@Operation(responses = { @ApiResponse(responseCode = "204") })
public Response foo() {
    return Response.noContent().build();
}

which should have the following representation:

/foo:
  get:
    responses:
      204:

But it is disregard @ApiResponse and fills-in the default response with a */* media type.

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 by reproducing the JAX-RS endpoint shown in the issue and inspect the generated OpenAPI YAML for its 204 response. Trace the response generation from the @ApiResponse annotation and compare the result with the expected response entry; done means the explicit 204 response is preserved without a / media type.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.