本文整理了Java中io.swagger.models.Swagger.response()
方法的一些代码示例,展示了Swagger.response()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.response()
方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:response
暂无
代码示例来源:origin: apache/servicecomb-java-chassis
public static void addResponse(Swagger swagger, ApiResponse apiResponse) {
ResponseConfig responseConfig = convert(apiResponse);
generateResponse(swagger, responseConfig);
swagger.response(String.valueOf(responseConfig.getCode()), responseConfig.getResponse());
}
代码示例来源:origin: Valandur/Web-API
@Override
public void beforeScan(Reader reader, Swagger swagger) {
swagger.addParameter("details", constructQueryParameter(
"details",
"Add to include additional details, omit or false otherwise"));
swagger.addParameter("accept", constructQueryParameter(
"accept",
"Override the 'Accept' request header (useful for debugging your requests)",
"json", "xml"));
swagger.addParameter("pretty", constructQueryParameter(
"pretty",
"Add to make the Web-API pretty print the response (useful for debugging your requests)"));
swagger.response("400", constructResponse(400, "Bad request"));
swagger.response("401", constructResponse(401, "Unauthorized"));
swagger.response("403", constructResponse(403, "Access denied"));
swagger.response("404", constructResponse(404, "Not found"));
swagger.response("500", constructResponse(500, "Internal server error"));
swagger.response("501", constructResponse(501, "Not implemented"));
}
代码示例来源:origin: org.apache.servicecomb/swagger-generator-core
public static void addResponse(Swagger swagger, ApiResponse apiResponse) {
ResponseConfig responseConfig = convert(apiResponse);
generateResponse(swagger, responseConfig);
swagger.response(String.valueOf(responseConfig.getCode()), responseConfig.getResponse());
}
内容来源于网络,如有侵权,请联系作者删除!