swaggo

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2022 License: MIT Imports: 4 Imported by: 0

README

Swaggo - v0.3.0

项目修改自:github.com/teambition/swaggo

修改内容:

  1. 项目本身支持 go mod
  2. 支持使用本工具的项目是 go mod 项目,不用再放到 go path 下了
  3. 个性化支持了分页响应,例如 // @Success 200 []schema.DeviceQRCodeResult "{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" 根据描述里含有 pagination 自动转化为分页结构体

About

Generate API documentation from annotations in Go code. It's always used for you Go server application. The swagger file accords to the Swagger Spec and displays it using Swagger UI(this project dosn't provide).

Quick Start Guide

Install

export GO111MODULE=on;
go install github.com/Jetereting/swaggo@vlatest

use

swaggo -s ./internal/app/smartpark/routers/wx/swagger.go -p . -o ./internal/app/smartpark/swagger/

Documentation

Overview

convert comments to swagger-api-doc just support swagger-2.0

Directories

Path Synopsis
@Version 1.0.0 @Title Swagger Example API @Description Swagger Example API @Host 127.0.0.1:3000 @BasePath /api @Name swagger @Contact [email protected] @URL teambition.com @TermsOfServiceUrl http://teambition.com/ @License Apache @LicenseUrl http://teambition.com/ @Schemes http,wss @Consumes json,plain,xml,html @Produces json,plain,xml,html
@Version 1.0.0 @Title Swagger Example API @Description Swagger Example API @Host 127.0.0.1:3000 @BasePath /api @Name swagger @Contact [email protected] @URL teambition.com @TermsOfServiceUrl http://teambition.com/ @License Apache @LicenseUrl http://teambition.com/ @Schemes http,wss @Consumes json,plain,xml,html @Produces json,plain,xml,html
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL