美文网首页
spring boot——使用openAPI反向生成API

spring boot——使用openAPI反向生成API

作者: 含泪若笑 | 来源:发表于2020-10-12 09:37 被阅读0次

1 下载openapi的yaml文件的模板,改成你想要的API。地址:https://editor.swagger.io/

2 需要这三个依赖,但也可以反向java code生成了,根据报错自行添加。

3 生成java code 只需要在pom文件中加入这个,run mvn clean compile就行。具体可参考https://www.baeldung.com/spring-boot-rest-client-swagger-codegen

4 显示API文档:

打开http://localhost:8080/swagger-ui/即可。

相关文章

网友评论

      本文标题:spring boot——使用openAPI反向生成API

      本文链接:https://www.haomeiwen.com/subject/xqhzjktx.html