生成SpringBoot REST控制器的Maven OpenAPI JSON

huangapple go评论75阅读模式
英文:

Maven Generate OpenAPI JSON for SpringBoot REST Controllers

问题

有没有一个可以在构建时为我的SpringBoot RestControllers生成openapi.json文件的Maven插件?

如果没有Maven插件,是否有另一个简单的包可以在构建时生成该文件?

我只需要openapi.json文件,不需要自动集成Swagger UI等。

英文:

Is there a Maven plugin which can generate an openapi.json file at build time for my SpringBoot RestControllers?

If not a Maven plugin, is there another simple package to generate the file at build time?

I only want the openapi.json file, I don't want Swagger UIs auto-integrated, etc.

答案1

得分: 1

我能够使用SpringDoc让这个工作起来。

我找不到一个完全符合我的用例(不包括所有的Swagger UI内容)的项目,所以我在GitHub上创建了一个示例项目,供其他人用作参考:springdoc-maven-plugin-demo

英文:

I was able to get this working with SpringDoc.

I couldn't find a project which showed exactly my use-case (without all the swagger ui stuff), so I created an example project on GitHub for others to use as reference: springdoc-maven-plugin-demo

答案2

得分: 0

你可以使用Spring-doc,它支持OpenAPI 3。

查看demos

英文:

You can use Spring-doc which support OpenAPI 3

Look at the demos

huangapple
  • 本文由 发表于 2020年1月7日 01:50:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/59616682.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定