use of io.servicecomb.swagger.extend.annotations.ResponseHeaders in project java-chassis by ServiceComb.
the class CodeFirstJaxrs method cseResponse.
// public Response getUserResponse() {
//
// }
@ApiResponse(code = 200, response = User.class, message = "")
@ResponseHeaders({ @ResponseHeader(name = "h1", response = String.class), @ResponseHeader(name = "h2", response = String.class) })
@Path("/cseResponse")
@GET
public Response cseResponse() {
Response response = Response.createSuccess(Status.ACCEPTED, new User());
response.getHeaders().addHeader("h1", "h1v").addHeader("h2", "h2v");
return response;
}
use of io.servicecomb.swagger.extend.annotations.ResponseHeaders in project java-chassis by ServiceComb.
the class CodeFirstSpringmvc method cseResponse.
@ApiResponse(code = 200, response = User.class, message = "")
@ResponseHeaders({ @ResponseHeader(name = "h1", response = String.class), @ResponseHeader(name = "h2", response = String.class) })
@RequestMapping(path = "/cseResponse", method = RequestMethod.GET)
public Response cseResponse() {
Response response = Response.createSuccess(Status.ACCEPTED, new User());
response.getHeaders().addHeader("h1", "h1v").addHeader("h2", "h2v");
return response;
}
use of io.servicecomb.swagger.extend.annotations.ResponseHeaders in project java-chassis by ServiceComb.
the class ResponseHeadersProcessor method process.
@Override
public void process(Object annotation, OperationGenerator operationGenerator) {
ResponseHeaders responseHeaders = (ResponseHeaders) annotation;
MethodAnnotationProcessor processor = operationGenerator.getContext().findMethodAnnotationProcessor(ResponseHeader.class);
for (ResponseHeader responseHeader : responseHeaders.value()) {
processor.process(responseHeader, operationGenerator);
}
}
use of io.servicecomb.swagger.extend.annotations.ResponseHeaders in project java-chassis by ServiceComb.
the class CodeFirstSpringmvc method responseEntity.
@ResponseHeaders({ @ResponseHeader(name = "h1", response = String.class), @ResponseHeader(name = "h2", response = String.class) })
@RequestMapping(path = "/responseEntity", method = RequestMethod.GET)
public ResponseEntity<User> responseEntity() {
HttpHeaders headers = new HttpHeaders();
headers.add("h1", "h1v");
headers.add("h2", "h2v");
return new ResponseEntity<User>(new User(), headers, HttpStatus.ACCEPTED);
}
Aggregations