swagger stub代码生成和使用
# 编写swagger注解
# 获得swagger api描述文件
如:
http://localhost:8081/v2/api-docs
# 将描述文件拷贝到swagger-editor网站
https://editor.swagger.io/
然后点击生成代码。
这样就可以得到这个api的stub代码,供开发或测试使用。
# 根据需要修改stub代码,即可返回相应的值,并可用于测试。
# 编写swagger注解
# 获得swagger api描述文件
如:
http://localhost:8081/v2/api-docs
# 将描述文件拷贝到swagger-editor网站
https://editor.swagger.io/
然后点击生成代码。
这样就可以得到这个api的stub代码,供开发或测试使用。
# 根据需要修改stub代码,即可返回相应的值,并可用于测试。