# swagger **Repository Path**: xushenghao/swagger ## Basic Information - **Project Name**: swagger - **Description**: This repository is not maintained anymore. Please use the latest v2 version of goframe for automatic API generating and swagger UI feature. - **Primary Language**: Go - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-06-28 - **Last Updated**: 2023-06-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gf-swagger Provides swagger API document feature for GoFrame project. ## Usage ### 1. Install gf cli tool Download and install gf cli tool: https://github.com/gogf/gf-cli ### 2. Install gf-swagger ```sh go get -u github.com/gogf/gf-swagger ``` ### 3. Produce and pack swagger.json Use command `gf swagger --pack` parses and produces the `/swagger/swagger.json` file and packs it to `/data/data-swagger.go`. > You can also use `gf run main.go --swagger -y` running your codes with hot-compiled-like feature and automatically packs the swagger files into your project. #### 4. Use the swagger plugin Install the swagger using as plugin: ```go package main import ( "github.com/gogf/gf-swagger/swagger" "gitee.com/micro-tools/wf/frame/g" ) func main() { s := g.Server() s.Plugin(&swagger.Swagger{}) s.SetPort(8199) s.Run() } ``` Start your server and visit: http://127.0.0.1:8199/swagger Enjoy! ## Comment and configuration As the swagger files are parsed and produced by third party tool, you can get details about comment at: https://github.com/swaggo/swag . GF swagger feature also supports configuration from file with `swagger` node. Supported configuration item names of the node please refer to the attribute names of Swagger struct: https://godoc.org/github.com/gogf/gf-swagger/swagger