您的位置: 首页> 后端语言> java 接口文档技术总结

java 接口文档技术总结

时间:2025-08-26 15:42:01 来源:互联网

技术总结

Springdoc OpenAPI

官网:https://springdoc.org

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
    <version>1.6.14</version>
</dependency>
http://localhost:8080/swagger-ui.html
或
http://localhost:8080/swagger-ui/index.html

Swagger + Springfox(已逐渐淘汰)

已不再积极维护

Smart-Doc(国产优秀工具)

官网:https://smart-doc-group.gitee.io/smart-doc-website/

不依赖注解,通过分析 Java 注释生成文档,不依赖Swagger

<plugin>
    <groupId>com.power.doc</groupId>
    <artifactId>smart-doc-maven-plugin</artifactId>
    <version>3.2.0</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>html</goal>
            </goals>
        </execution>
    </executions>
</plugin>

YApi + 自动生成对接

Knife4j

官网:https://doc.xiaominfo.com/

是对 swagger-bootstrap-ui 的升级版本

<dependency>
    <groupId>com.github.xiaoymin</groupId>
    <artifactId>knife4j-spring-boot-starter</artifactId>
    <version>3.0.3</version>
</dependency>
http://localhost:8080/doc.html

 

swagger说明

Spring Boot 中常用的 Swagger 实现框架:

OpenAPI Specification (OAS)
       ↑
       └── Swagger(原始实现)
               ├── Swagger UI
               ├── Swagger Core
               └── Swagger Codegen
       └── Springdoc OpenAPI(现代实现)
               ├── 支持 OpenAPI 3.0
               └── 集成 Swagger UI 展示
       └── Knife4j(国产增强版)
               ├── 基于 Swagger UI
               └── 支持 Spring Boot

 

上一篇:java knife4j接口文档集成 下一篇:java 阿里云ECS服务器使用总结

相关文章

相关应用

最近更新