如何使用swagger2輕鬆生成線上介面文件
- 在pom.xml中引入依賴
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>swagger-spring-boot-starter</artifactId>
<version>1.8.0.RELEASE</version>
</dependency>
- 在應用主類中增加@EnableSwagger2Doc註解
@SpringBootApplication
@EnableSwagger2Doc
public class SpringDataJpaApplication {
public static void main(String[] args) {
SpringApplication.run(SpringDataJpaApplication.class, args);
}
}
- 引數配置示例
swagger.enabled=true
swagger.title=spring-data-jpa module
swagger.description=Starter for swagger 2.x
swagger.license=Apache License, Version 2.0
swagger.licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.html
swagger.termsOfServiceUrl=https://github.com/dyc87112/spring-boot-starter-swagger
swagger.contact.name=RanRan Tao
swagger.contact.url=https://www.jianshu.com/u/822585e5c69a
swagger.contact.email=16422802@qq.com
swagger.base-package=com.example.controller
swagger.base-path=/**
swagger.exclude-path=/error, /ops/**
- 預設情況下就能產生所有當前SpringMVC載入的請求對映文件
訪問地址:http://localhost:8080/swagger-ui.html
相關文章
- 線上API介面文件swagger2APISwagger
- 如何使用Swagger-UI線上生成漂亮的介面文件SwaggerUI
- 介面文件生成
- 教你如何使用線上工具輕鬆設計宣傳海報!
- 介面文件生成工具
- 手把手教你使用 Java 線上生成 pdf 文件Java
- SpringBoot整合Swagger2,3分鐘輕鬆入手!Spring BootSwagger
- springMVC整合swagger2來輸出介面文件SpringMVCSwagger
- Go語言使用swagger生成介面文件GoSwagger
- 輕鬆生成小程式分享海報
- Spring boot 之自動生成API文件swagger2Spring BootAPISwagger
- 介面文件生成詳細教程
- DRF 自動生成介面文件
- 自動生成介面文件coreapiAPI
- 在國內如何輕鬆用上GPT4介面?GPT
- 輕鬆編排工作流,淺談DolphinScheduler如何使用Python呼叫API介面?PythonAPI
- 我用這些開源專案輕鬆搭建了一個線上文件平臺
- Knife4j輕鬆聚合雲端OpenAPI文件API
- SpringBoot介面 - 如何生成介面文件之非侵入方式(通過註釋生成)Smart-Doc?Spring Boot
- php註釋生成介面文件 apidoc 安裝以及使用PHPAPI
- 如何輕鬆地為EA建立程式碼生成器 -DZone JavaJava
- 輕鬆使用Aspire rabbitmq frameworkMQFramework
- 用 Algolia DocSearch 輕鬆實現文件全站搜尋Go
- 快速生成好看實用的介面文件
- 使用Swagger實現webapi介面自動化文件生成SwaggerWebAPI
- 如何輕鬆拿到 淘寶前端 offer前端
- 如何輕鬆利用GPU加速機器學習?GPU機器學習
- 如何快速生成JavaScript文件JavaScript
- 線上生成二維碼的API介面API
- SpringBoot整合Swagger2,再也不用維護介面文件了!Spring BootSwagger
- 雲脈紙質文件管理系統:多重檢索輕鬆查詢文件
- 輕鬆將Word文件快速轉成Flash檔案(轉)
- FloatWindow 輕鬆實現安卓任意介面懸浮窗安卓
- 技術乾貨| 如何在MongoDB中輕鬆使用GridFS?MongoDB
- 如何使用MindStudio輕鬆搞定大模型全流程開發大模型
- 如何輕鬆歸檔檔案?2種方法輕鬆建立歸檔檔案!
- 如何輕鬆學習 Kubernetes?
- 如何輕鬆記住 Linux 命令Linux