swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.36k stars 2.17k forks source link

Representing "204 No Content" with jax-rs #4693

Open arteymix opened 2 weeks ago

arteymix commented 2 weeks ago

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.