本文整理了Java中io.swagger.models.Swagger.addParameter()
方法的一些代码示例,展示了Swagger.addParameter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.addParameter()
方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:addParameter
暂无
代码示例来源:origin: kongchen/swagger-maven-plugin
throw new RuntimeException(msg);
swagger.addParameter(param.getName(), param);
代码示例来源:origin: apache/servicecomb-java-chassis
@Override
public void process(Object annotation, SwaggerGenerator swaggerGenerator) {
ApiImplicitParam paramAnnotation = (ApiImplicitParam) annotation;
Parameter parameter = AnnotationUtils.createParameter(swaggerGenerator.getSwagger(), paramAnnotation);
swaggerGenerator.getSwagger().addParameter(parameter.getName(), parameter);
}
}
代码示例来源:origin: io.swagger/swagger-models
public Swagger parameter(String key, Parameter parameter) {
this.addParameter(key, parameter);
return this;
}
代码示例来源:origin: org.apache.servicecomb/swagger-generator-core
@Override
public void process(Object annotation, SwaggerGenerator swaggerGenerator) {
ApiImplicitParam paramAnnotation = (ApiImplicitParam) annotation;
Parameter parameter = AnnotationUtils.createParameter(swaggerGenerator.getSwagger(), paramAnnotation);
swaggerGenerator.getSwagger().addParameter(parameter.getName(), parameter);
}
}
代码示例来源: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"));
}
内容来源于网络,如有侵权,请联系作者删除!