springdoc-openapi is made possible thanks to all of its contributors.
The springdoc-openapi Java library helps automating the generation of API documentation using Spring Boot projects. springdoc-openapi works by examining an application at runtime to infer API semantics based on Spring configurations, class structure and various annotations.
The library automatically generates documentation in JSON/YAML and HTML formatted pages. The generated documentation can be complemented using swagger-api
annotations.
This library supports:
The following video introduces the Library:
This is a community-based project, not maintained by the Spring Framework Contributors (Pivotal)
server
: The server name or IPport
: The server portcontext-path
: The context path of the applicationspringdoc-openapi-ui
library to the list of your project dependencies (No additional configuration is needed): <dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>last-release-version</version>
</dependency>
# swagger-ui custom path
springdoc.swagger-ui.path=/swagger-ui.html
server
: The server name or IPport
: The server portcontext-path
: The context path of the application/v3/api-docs.yaml
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webmvc-core</artifactId>
<version>last-release-version</version>
</dependency>
# /api-docs endpoint custom path
springdoc.api-docs.path=/api-docs
springdoc-openapi
endpoints, add a custom springdoc property, in your spring-boot
configuration file:# disable api-docs
springdoc.api-docs.enabled=false
To generate documentation automatically, make sure all the methods declare the HTTP Code responses using the annotation: @ResponseStatus
The library uses spring-boot application auto-configured packages to scan for the following annotations in spring beans: OpenAPIDefinition and Info.
These annotations declare, API Information: Title, version, licence, security, servers, tags, security and externalDocs.
For better performance of documentation generation, declare @OpenAPIDefinition
and @SecurityScheme
annotations within a Spring managed bean.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webflux-ui</artifactId>
<version>last-release-version</version>
</dependency>
# swagger-ui custom path
springdoc.swagger-ui.path=/swagger-ui.html
The springdoc-openapi
libraries are hosted on maven central repository.
The artifacts can be viewed accessed at the following locations:
Releases:
Snapshots:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。