-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
AcceptHeaderApiListingResource.java
42 lines (36 loc) · 1.21 KB
/
AcceptHeaderApiListingResource.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package io.swagger.jaxrs.listing;
import io.swagger.annotations.ApiOperation;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.*;
/**
* Created by rbolles on 2/15/16.
*/
@Path("/swagger")
public class AcceptHeaderApiListingResource extends BaseApiListingResource {
@Context
ServletContext context;
@GET
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(value = "The swagger definition in JSON", hidden = true)
public Response getListingJson(
@Context Application app,
@Context ServletConfig sc,
@Context HttpHeaders headers,
@Context UriInfo uriInfo) {
return getListingJsonResponse(app, context, sc, headers, uriInfo);
}
@GET
@Produces("application/yaml")
@ApiOperation(value = "The swagger definition in YAML", hidden = true)
public Response getListingYaml(
@Context Application app,
@Context ServletConfig sc,
@Context HttpHeaders headers,
@Context UriInfo uriInfo) {
return getListingYamlResponse(app, context, sc, headers, uriInfo);
}
}