Swagger基礎學習

2021-10-07 16:36:27 字數 750 閱讀 8132

api框架

restful文件自動生成工具,api文件與定義的同步更新

使用兩個庫

>

>

io.springfoxgroupid

>

>

springfox-swagger-uiartifactid

>

>

2.10.5version

>

dependency

>

>

>

io.springfoxgroupid

>

>

springfox-swagger2artifactid

>

>

2.9.2version

>

dependency

>

sprinboot裡面新增swaggerconfi

@configuration

@enableswagger2

public

class

swaggerconfig

//修改預設配置

private apiinfo apiinfo()

}

修改掃瞄路徑

//修改掃瞄路徑

@bean

public docket docket()

配置api文件的分組

Swagger基礎總結

the best apis are built with swagger tools swagger分為四部分 1.openapi規範的版本號 通過乙個 swagger 屬性來宣告openapi規範的版本。swagger 2.0 2.api描述資訊 文件相關資訊 info version 1.0.0...

Swagger基礎配置

前後端分離開發模式中,api文件是最好的溝通方式。swagger 是乙個規範和完整的框架,用於生成 描述 呼叫和視覺化 restful 風格的 web 服務。1.及時性 介面變更後,能夠及時準確地通知相關前後端開發人員 2.規範性 並且保證介面的規範性,如介面的位址,請求方式,引數及響應格式和錯誤資...

Swagger學習筆記(2020 11 17)

1.建立乙個spring boot web專案 2.匯入相關依賴 io.springfox springfox swagger2 2.9.2 io.springfox springfox swagger ui 2.9.2 3.編寫helloword 4.配置swagger config config...