Automatically generate RESTful API documentation with Swagger 2.0 for Go.

Overview

swag

🌍 English简体中文

Travis Status Coverage Status Go Report Card codebeat badge Go Doc Backers on Open Collective Sponsors on Open Collective FOSSA Status Release

Swag converts Go annotations to Swagger Documentation 2.0. We've created a variety of plugins for popular Go web frameworks. This allows you to quickly integrate with an existing Go project (using Swagger UI).

Contents

Getting started

  1. Add comments to your API source code, See Declarative Comments Format.

  2. Download swag by using:

$ go get -u github.com/swaggo/swag/cmd/swag

To build from source you need Go (1.9 or newer).

Or download a pre-compiled binary from the release page.

  1. Run swag init in the project's root folder which contains the main.go file. This will parse your comments and generate the required files (docs folder and docs/docs.go).
$ swag init

Make sure to import the generated docs/docs.go so that your specific configuration gets init'ed. If your General API annotations do not live in main.go, you can let swag know with -g flag.

swag init -g http/api.go

swag cli

$ swag init -h
NAME:
   swag init - Create docs.go

USAGE:
   swag init [command options] [arguments...]

OPTIONS:
   --generalInfo value, -g value          Go file path in which 'swagger general API Info' is written (default: "main.go")
   --dir value, -d value                  Directory you want to parse (default: "./")
   --exclude value                        Exclude directories and files when searching, comma separated
   --propertyStrategy value, -p value     Property Naming Strategy like snakecase,camelcase,pascalcase (default: "camelcase")
   --output value, -o value               Output directory for all the generated files(swagger.json, swagger.yaml and doc.go) (default: "./docs")
   --parseVendor                          Parse go files in 'vendor' folder, disabled by default (default: false)
   --parseDependency                      Parse go files in outside dependency folder, disabled by default (default: false)
   --markdownFiles value, --md value      Parse folder containing markdown files to use as description, disabled by default
   --codeExampleFiles value, --cef value  Parse folder containing code example files to use for the x-codeSamples extension, disabled by default
   --parseInternal                        Parse go files in internal packages, disabled by default (default: false)
   --generatedTime                        Generate timestamp at the top of docs.go, disabled by default (default: false)
   --parseDepth value                     Dependency parse depth (default: 100)
   --help, -h                             show help (default: false)

Supported Web Frameworks

How to use it with Gin

Find the example source code here.

  1. After using swag init to generate Swagger 2.0 docs, import the following packages:
import "github.com/swaggo/gin-swagger" // gin-swagger middleware
import "github.com/swaggo/files" // swagger embed files
  1. Add General API annotations in main.go code:
// @title Swagger Example API
// @version 1.0
// @description This is a sample server celler server.
// @termsOfService http://swagger.io/terms/

// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email [email protected]

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @host localhost:8080
// @BasePath /api/v1
// @query.collection.format multi

// @securityDefinitions.basic BasicAuth

// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization

// @securitydefinitions.oauth2.application OAuth2Application
// @tokenUrl https://example.com/oauth/token
// @scope.write Grants write access
// @scope.admin Grants read and write access to administrative information

// @securitydefinitions.oauth2.implicit OAuth2Implicit
// @authorizationurl https://example.com/oauth/authorize
// @scope.write Grants write access
// @scope.admin Grants read and write access to administrative information

// @securitydefinitions.oauth2.password OAuth2Password
// @tokenUrl https://example.com/oauth/token
// @scope.read Grants read access
// @scope.write Grants write access
// @scope.admin Grants read and write access to administrative information

// @securitydefinitions.oauth2.accessCode OAuth2AccessCode
// @tokenUrl https://example.com/oauth/token
// @authorizationurl https://example.com/oauth/authorize
// @scope.admin Grants read and write access to administrative information

// @x-extension-openapi {"example": "value on a json format"}

func main() {
	r := gin.Default()

	c := controller.NewController()

	v1 := r.Group("/api/v1")
	{
		accounts := v1.Group("/accounts")
		{
			accounts.GET(":id", c.ShowAccount)
			accounts.GET("", c.ListAccounts)
			accounts.POST("", c.AddAccount)
			accounts.DELETE(":id", c.DeleteAccount)
			accounts.PATCH(":id", c.UpdateAccount)
			accounts.POST(":id/images", c.UploadAccountImage)
		}
    //...
	}
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	r.Run(":8080")
}
//...

Additionally some general API info can be set dynamically. The generated code package docs exports SwaggerInfo variable which we can use to set the title, description, version, host and base path programmatically. Example using Gin:

package main

import (
	"github.com/gin-gonic/gin"
	"github.com/swaggo/files"
	"github.com/swaggo/gin-swagger"
	
	"./docs" // docs is generated by Swag CLI, you have to import it.
)

// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email [email protected]

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @termsOfService http://swagger.io/terms/

func main() {

	// programmatically set swagger info
	docs.SwaggerInfo.Title = "Swagger Example API"
	docs.SwaggerInfo.Description = "This is a sample server Petstore server."
	docs.SwaggerInfo.Version = "1.0"
	docs.SwaggerInfo.Host = "petstore.swagger.io"
	docs.SwaggerInfo.BasePath = "/v2"
	docs.SwaggerInfo.Schemes = []string{"http", "https"}
		
	r := gin.New()

	// use ginSwagger middleware to serve the API docs
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))

	r.Run()
}
  1. Add API Operation annotations in controller code
package controller

import (
	"fmt"
	"net/http"
	"strconv"

	"github.com/gin-gonic/gin"
	"github.com/swaggo/swag/example/celler/httputil"
	"github.com/swaggo/swag/example/celler/model"
)

// ShowAccount godoc
// @Summary Show a account
// @Description get string by ID
// @ID get-string-by-int
// @Accept  json
// @Produce  json
// @Param id path int true "Account ID"
// @Success 200 {object} model.Account
// @Header 200 {string} Token "qwerty"
// @Failure 400,404 {object} httputil.HTTPError
// @Failure 500 {object} httputil.HTTPError
// @Failure default {object} httputil.DefaultError
// @Router /accounts/{id} [get]
func (c *Controller) ShowAccount(ctx *gin.Context) {
	id := ctx.Param("id")
	aid, err := strconv.Atoi(id)
	if err != nil {
		httputil.NewError(ctx, http.StatusBadRequest, err)
		return
	}
	account, err := model.AccountOne(aid)
	if err != nil {
		httputil.NewError(ctx, http.StatusNotFound, err)
		return
	}
	ctx.JSON(http.StatusOK, account)
}

// ListAccounts godoc
// @Summary List accounts
// @Description get accounts
// @Accept  json
// @Produce  json
// @Param q query string false "name search by q"
// @Success 200 {array} model.Account
// @Header 200 {string} Token "qwerty"
// @Failure 400,404 {object} httputil.HTTPError
// @Failure 500 {object} httputil.HTTPError
// @Failure default {object} httputil.DefaultError
// @Router /accounts [get]
func (c *Controller) ListAccounts(ctx *gin.Context) {
	q := ctx.Request.URL.Query().Get("q")
	accounts, err := model.AccountsAll(q)
	if err != nil {
		httputil.NewError(ctx, http.StatusNotFound, err)
		return
	}
	ctx.JSON(http.StatusOK, accounts)
}

//...
$ swag init
  1. Run your app, and browse to http://localhost:8080/swagger/index.html. You will see Swagger 2.0 Api documents as shown below:

swagger_index.html

Implementation Status

Swagger 2.0 document

  • Basic Structure
  • API Host and Base Path
  • Paths and Operations
  • Describing Parameters
  • Describing Request Body
  • Describing Responses
  • MIME Types
  • Authentication
    • Basic Authentication
    • API Keys
  • Adding Examples
  • File Upload
  • Enums
  • Grouping Operations With Tags
  • Swagger Extensions

Declarative Comments Format

General API Info

Example celler/main.go

annotation description example
title Required. The title of the application. // @title Swagger Example API
version Required. Provides the version of the application API. // @version 1.0
description A short description of the application. // @description This is a sample server celler server.
tag.name Name of a tag. // @tag.name This is the name of the tag
tag.description Description of the tag // @tag.description Cool Description
tag.docs.url Url of the external Documentation of the tag // @tag.docs.url https://example.com
tag.docs.description Description of the external Documentation of the tag // @tag.docs.description Best example documentation
termsOfService The Terms of Service for the API. // @termsOfService http://swagger.io/terms/
contact.name The contact information for the exposed API. // @contact.name API Support
contact.url The URL pointing to the contact information. MUST be in the format of a URL. // @contact.url http://www.swagger.io/support
contact.email The email address of the contact person/organization. MUST be in the format of an email address. // @contact.email [email protected]
license.name Required. The license name used for the API. // @license.name Apache 2.0
license.url A URL to the license used for the API. MUST be in the format of a URL. // @license.url http://www.apache.org/licenses/LICENSE-2.0.html
host The host (name or ip) serving the API. // @host localhost:8080
BasePath The base path on which the API is served. // @BasePath /api/v1
query.collection.format The default collection(array) param format in query,enums:csv,multi,pipes,tsv,ssv. If not set, csv is the default. // @query.collection.format multi
schemes The transfer protocol for the operation that separated by spaces. // @schemes http https
x-name The extension key, must be start by x- and take only json value // @x-example-key {"key": "value"}

Using markdown descriptions

When a short string in your documentation is insufficient, or you need images, code examples and things like that you may want to use markdown descriptions. In order to use markdown descriptions use the following annotations.

annotation description example
title Required. The title of the application. // @title Swagger Example API
version Required. Provides the version of the application API. // @version 1.0
description.markdown A short description of the application. Parsed from the api.md file. This is an alternative to @description // @description.markdown No value needed, this parses the description from api.md
tag.name Name of a tag. // @tag.name This is the name of the tag
tag.description.markdown Description of the tag this is an alternative to tag.description. The description will be read from a file named like tagname.md // @tag.description.markdown

API Operation

Example celler/controller

annotation description
description A verbose explanation of the operation behavior.
description.markdown A short description of the application. The description will be read from a file named like endpointname.md
id A unique string used to identify the operation. Must be unique among all API operations.
tags A list of tags to each API operation that separated by commas.
summary A short summary of what the operation does.
accept A list of MIME types the APIs can consume. Value MUST be as described under Mime Types.
produce A list of MIME types the APIs can produce. Value MUST be as described under Mime Types.
param Parameters that separated by spaces. param name,param type,data type,is mandatory?,comment attribute(optional)
security Security to each API operation.
success Success response that separated by spaces. return code or default,{param type},data type,comment
failure Failure response that separated by spaces. return code or default,{param type},data type,comment
response As same as success and failure
header Header in response that separated by spaces. return code,{param type},data type,comment
router Path definition that separated by spaces. path,[httpMethod]
x-name The extension key, must be start by x- and take only json value.
x-codeSample Optional Markdown usage. take file as parameter. This will then search for a file named like the summary in the given folder.
deprecated Mark endpoint as deprecated.

Mime Types

swag accepts all MIME Types which are in the correct format, that is, match */*. Besides that, swag also accepts aliases for some MIME Types as follows:

Alias MIME Type
json application/json
xml text/xml
plain text/plain
html text/html
mpfd multipart/form-data
x-www-form-urlencoded application/x-www-form-urlencoded
json-api application/vnd.api+json
json-stream application/x-json-stream
octet-stream application/octet-stream
png image/png
jpeg image/jpeg
gif image/gif

Param Type

  • query
  • path
  • header
  • body
  • formData

Data Type

  • string (string)
  • integer (int, uint, uint32, uint64)
  • number (float32)
  • boolean (bool)
  • user defined struct

Security

annotation description parameters example
securitydefinitions.basic Basic auth. // @securityDefinitions.basic BasicAuth
securitydefinitions.apikey API key auth. in, name // @securityDefinitions.apikey ApiKeyAuth
securitydefinitions.oauth2.application OAuth2 application auth. tokenUrl, scope // @securitydefinitions.oauth2.application OAuth2Application
securitydefinitions.oauth2.implicit OAuth2 implicit auth. authorizationUrl, scope // @securitydefinitions.oauth2.implicit OAuth2Implicit
securitydefinitions.oauth2.password OAuth2 password auth. tokenUrl, scope // @securitydefinitions.oauth2.password OAuth2Password
securitydefinitions.oauth2.accessCode OAuth2 access code auth. tokenUrl, authorizationUrl, scope // @securitydefinitions.oauth2.accessCode OAuth2AccessCode
parameters annotation example
in // @in header
name // @name Authorization
tokenUrl // @tokenUrl https://example.com/oauth/token
authorizationurl // @authorizationurl https://example.com/oauth/authorize
scope.hoge // @scope.write Grants write access

Attribute

// @Param enumstring query string false "string enums" Enums(A, B, C)
// @Param enumint query int false "int enums" Enums(1, 2, 3)
// @Param enumnumber query number false "int enums" Enums(1.1, 1.2, 1.3)
// @Param string query string false "string valid" minlength(5) maxlength(10)
// @Param int query int false "int valid" minimum(1) maximum(10)
// @Param default query string false "string default" default(A)
// @Param collection query []string false "string collection" collectionFormat(multi)

It also works for the struct fields:

type Foo struct {
    Bar string `minLength:"4" maxLength:"16"`
    Baz int `minimum:"10" maximum:"20" default:"15"`
    Qux []string `enums:"foo,bar,baz"`
}

Available

Field Name Type Description
validate string Determines the validation for the parameter. Possible values are: required.
default * Declares the value of the parameter that the server will use if none is provided, for example a "count" to control the number of results per page might default to 100 if not supplied by the client in the request. (Note: "default" has no meaning for required parameters.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for this parameter.
maximum number See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
minimum number See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
maxLength integer See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
minLength integer See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
enums [*] See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1.
format string The extending format for the previously mentioned type. See Data Type Formats for further details.
collectionFormat string Determines the format of the array if type array is used. Possible values are:
  • csv - comma separated values foo,bar.
  • ssv - space separated values foo bar.
  • tsv - tab separated values foo\tbar.
  • pipes - pipe separated values foo|bar.
  • multi - corresponds to multiple parameter instances instead of multiple values for a single instance foo=bar&foo=baz. This is valid only for parameters in "query" or "formData".
Default value is csv.

Future

Field Name Type Description
multipleOf number See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.
pattern string See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
maxItems integer See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
minItems integer See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.
uniqueItems boolean See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.

Examples

Descriptions over multiple lines

You can add descriptions spanning multiple lines in either the general api description or routes definitions like so:

// @description This is the first line
// @description This is the second line
// @description And so forth.

User defined structure with an array type

// @Success 200 {array} model.Account <-- This is a user defined struct.
package model

type Account struct {
    ID   int    `json:"id" example:"1"`
    Name string `json:"name" example:"account name"`
}

Model composition in response

// JSONResult's data field will be overridden by the specific type proto.Order
@success 200 {object} jsonresult.JSONResult{data=proto.Order} "desc"
type JSONResult struct {
    Code    int          `json:"code" `
    Message string       `json:"message"`
    Data    interface{}  `json:"data"`
}

type Order struct { //in `proto` package
    Id  uint            `json:"id"`
    Data  interface{}   `json:"data"`
}
  • also support array of objects and primitive types as nested response
@success 200 {object} jsonresult.JSONResult{data=[]proto.Order} "desc"
@success 200 {object} jsonresult.JSONResult{data=string} "desc"
@success 200 {object} jsonresult.JSONResult{data=[]string} "desc"
  • overriding multiple fields. field will be added if not exists
@success 200 {object} jsonresult.JSONResult{data1=string,data2=[]string,data3=proto.Order,data4=[]proto.Order} "desc"
  • overriding deep-level fields
type DeepObject struct { //in `proto` package
	...
}
@success 200 {object} jsonresult.JSONResult{data1=proto.Order{data=proto.DeepObject},data2=[]proto.Order{data=[]proto.DeepObject}} "desc"

Add a headers in response

// @Success 200 {string} string	"ok"
// @failure 400 {string} string	"error"
// @response default {string} string	"other error"
// @Header 200 {string} Location "/entity/1"
// @Header 200,400,default {string} Token "token"
// @Header all {string} Token2 "token2"

Use multiple path params

/// ...
// @Param group_id path int true "Group ID"
// @Param account_id path int true "Account ID"
// ...
// @Router /examples/groups/{group_id}/accounts/{account_id} [get]

Example value of struct

type Account struct {
    ID   int    `json:"id" example:"1"`
    Name string `json:"name" example:"account name"`
    PhotoUrls []string `json:"photo_urls" example:"http://test/image/1.jpg,http://test/image/2.jpg"`
}

Description of struct

type Account struct {
	// ID this is userid
	ID   int    `json:"id"`
	Name string `json:"name"` // This is Name
}

Use swaggertype tag to supported custom type

#201

type TimestampTime struct {
    time.Time
}

///implement encoding.JSON.Marshaler interface
func (t *TimestampTime) MarshalJSON() ([]byte, error) {
    bin := make([]byte, 16)
    bin = strconv.AppendInt(bin[:0], t.Time.Unix(), 10)
    return bin, nil
}

func (t *TimestampTime) UnmarshalJSON(bin []byte) error {
    v, err := strconv.ParseInt(string(bin), 10, 64)
    if err != nil {
        return err
    }
    t.Time = time.Unix(v, 0)
    return nil
}
///

type Account struct {
    // Override primitive type by simply specifying it via `swaggertype` tag
    ID     sql.NullInt64 `json:"id" swaggertype:"integer"`

    // Override struct type to a primitive type 'integer' by specifying it via `swaggertype` tag
    RegisterTime TimestampTime `json:"register_time" swaggertype:"primitive,integer"`

    // Array types can be overridden using "array," format
    Coeffs []big.Float `json:"coeffs" swaggertype:"array,number"`
}

#379

type CerticateKeyPair struct {
	Crt []byte `json:"crt" swaggertype:"string" format:"base64" example:"U3dhZ2dlciByb2Nrcw=="`
	Key []byte `json:"key" swaggertype:"string" format:"base64" example:"U3dhZ2dlciByb2Nrcw=="`
}

generated swagger doc as follows:

"api.MyBinding": {
  "type":"object",
  "properties":{
    "crt":{
      "type":"string",
      "format":"base64",
      "example":"U3dhZ2dlciByb2Nrcw=="
    },
    "key":{
      "type":"string",
      "format":"base64",
      "example":"U3dhZ2dlciByb2Nrcw=="
    }
  }
}

Use swaggerignore tag to exclude a field

type Account struct {
    ID   string    `json:"id"`
    Name string     `json:"name"`
    Ignored int     `swaggerignore:"true"`
}

Add extension info to struct field

type Account struct {
    ID   string    `json:"id"   extensions:"x-nullable,x-abc=def"` // extensions fields must start with "x-"
}

generate swagger doc as follows:

"Account": {
    "type": "object",
    "properties": {
        "id": {
            "type": "string",
            "x-nullable": true,
            "x-abc": "def"
        }
    }
}

Rename model to display

type Resp struct {
	Code int
}//@name Response

How to using security annotations

General API info.

// @securityDefinitions.basic BasicAuth

// @securitydefinitions.oauth2.application OAuth2Application
// @tokenUrl https://example.com/oauth/token
// @scope.write Grants write access
// @scope.admin Grants read and write access to administrative information

Each API operation.

// @Security ApiKeyAuth

Make it AND condition

// @Security ApiKeyAuth
// @Security OAuth2Application[write, admin]

About the Project

This project was inspired by yvasiyarov/swagger but we simplified the usage and added support a variety of web frameworks. Gopher image source is tenntenn/gopher-stickers. It has licenses creative commons licensing.

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

FOSSA Status

Comments
  • Imporve performance when generating spec with external dependencies

    Imporve performance when generating spec with external dependencies

    Describe the PR

    Directly use go list command instead of depth, because depth use go standard library build.Import and call the build.Import too many times, it will spent too many times when the large dependencies.

    Because swag only needs to know which files are dependent, and does not need to get the level of dependencies, all dependencies can be directly through go list command, and swag not need to go through deep loop again, but if use depth, swag still need to loop too many times, so i refactor the swag get ast files code.

    Relation issue

    Fixes: https://github.com/swaggo/swag/issues/1032

    Additional context

    Added the --parseGoList flag, the default value is true default. If someone does not want to enable it, it can be set to false when init, if it's set to false, swag still use depth for dependency parser.

    opened by pytimer 32
  • undefined:

    undefined: "github.com/swaggo/swag".Spec

    hi, i have been using this repo for a while now. just a few hours ago, it suddenly threw out the error below:

    docs/docs.go:11152:28: undefined: "github.com/swaggo/swag".Spec

    may i know how to get rid of this error? thank you.

    opened by bashdrew 29
  • Swag init no longer works after updating to 1.5.1

    Swag init no longer works after updating to 1.5.1

    Describe the bug Previously used Swaggo/Swag 1.5.0. No longer works after updating to 1.5.1. Getting the following output:

    2019/07/01 10:31:18 Generate swagger docs....
    2019/07/01 10:31:18 Generate general API Info
    2019/07/01 10:31:18 execute go list command, exit status 1
    

    To Reproduce Not entirely sure. Using a standard layout with cmd, pkg and internal folders. Running swag init from project root folder.

    Steps to reproduce the behavior:

    1. Use swag 1.5.1
    2. Run swag init.

    Expected behavior Swag generates swagger docs in docs-folder.

    Your swag version 1.5.1

    Your go version 1.12.6

    opened by lsattem 25
  • swag init command not running

    swag init command not running

    Describe the bug Swag init is not working.

    To Reproduce Steps to reproduce the behavior:

    1. Extract swaggo/swag
    2. run swag init in the root folder Expected behavior Command:swag not found

    Screenshots If applicable, add screenshots to help explain your problem.

    Your swag version e.g. v1.2.0

    Desktop (please complete the following information):

    • Ubuntu
    • Mozilla

    Additional context Add any other context about the problem here.

    opened by shantanuaggarwal2695 25
  • Doesn't working with import alias for struct fields

    Doesn't working with import alias for struct fields

    Describe the bug When we add import alias for custom type of struct field with this custom type that is not working.

    To Reproduce Put the struct with custom type from other package and add alias for this custom type:

    package build
    
    import (
           	domainapp "domain/application"
    )
    
    type ListResponse struct {
    	BuildInfos []domainapp.BuildInfo `json:"data"`
    	Err        error                 `json:"-"`
    }
    

    And some handler with comment

    // @Success 200 {object} build.ListResponse
    

    Run yaml:

    swag init -g ./main.go --parseDependency --parseVendor
    

    Result:

    build.ListResponse:
        properties:
          data:
            type: string
        type: object
    

    Expected behavior Expected result yaml:

    build.ListResponse:
        properties:
          data:
            items:
              $ref: '#/definitions/application.BuildInfo'
            type: array
        type: object
    

    Your swag version swag version v1.6.2

    Your go version go version go1.12.5 linux/amd64

    enhancement 
    opened by dsxack 23
  • Cannot update to 1.6.6: checksum mismatch

    Cannot update to 1.6.6: checksum mismatch

    Describe the bug I can't update to version 1.6.6.

    To Reproduce

    go get -u github.com/swaggo/swag
    

    will return the following error message:

    go: downloading github.com/swaggo/swag v1.6.6
    verifying github.com/swaggo/[email protected]: checksum mismatch
            downloaded: h1:ujSziE+CfBxr5eIsVJgjGNbDxq1zPfLHxlu5NJmRFSQ=
            sum.golang.org: h1:3YX5hmuUyCMT/OqqnjW92gULAfHg3hVjpcPm53N64RY=
    
    SECURITY ERROR
    This download does NOT match the one reported by the checksum server.
    The bits may have been replaced on the origin server, or an attacker may
    have intercepted the download attempt.
    
    For more information, see 'go help module-auth'.
    

    Expected behavior

    Package updates without issues.

    Your swag version 1.6.6

    Your go version go version go1.13.5 linux/amd64

    bug 
    opened by kolaente 21
  • Alias typecould not resolve

    Alias typecould not resolve

    Describe the bug Resolver error at paths./ad/all.get.responses.200.schema.items.properties.status.$ref Could not resolve reference because of: Could not resolve pointer: /definitions/web.T does not exist in document

    To Reproduce

    // APIError example
    type APIError struct {
    	ErrorCode    int
    	ErrorMessage string
    	CreatedAt    time.Time
    	Type         APIType
    }
    type T uint8
    
    type APIType 
    

    Expected behavior generate

    "web.T": {
                "type": "integer"
            },
    

    Your swag version 1.6.5

    Your go version go1.13.5 darwin/amd64

    Desktop (please complete the following information):

    • OS: macOS 10.15.4
    opened by epolar 18
  • panic: runtime error: invalid memory address or nil pointer dereference

    panic: runtime error: invalid memory address or nil pointer dereference

    Describe the bug panic: runtime error: invalid memory address or nil pointer dereference when I use swag init --parseDependency

    To Reproduce

    export GO111MODULE=on
    swag init --parseDependency
    
    2019/11/22 12:04:01 Generate swagger docs....
    2019/11/22 12:04:01 Generate general API Info, search dir:./
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x843d12]
    
    goroutine 1 [running]:
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc0005bda30, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1323 +0x62
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc00098f980, 0x46, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1341 +0x13e
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc0007529a0, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1341 +0x13e
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc0007bb238, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1341 +0x13e
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc0005a9390, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1341 +0x13e
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc0007cd658, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1341 +0x13e
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc0009594f8, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1341 +0x13e
    github.com/swaggo/swag.(*Parser).getAllGoFileInfoFromDeps(0xc0002bce00, 0xc000919130, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:1341 +0x13e
    github.com/swaggo/swag.(*Parser).ParseAPI(0xc0002bce00, 0x9a2ee1, 0x2, 0x9a60f9, 0x7, 0x0, 0xc0003314d0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/parser.go:130 +0x44c
    github.com/swaggo/swag/gen.(*Gen).Build(0xc008e595de, 0xc008e59640, 0x0, 0x0)
    	/root/pkg/mod/github.com/swaggo/[email protected]/gen/gen.go:66 +0x2c4
    main.main.func1(0xc00022e2c0, 0x0, 0xc00011e310)
    	/root/pkg/mod/github.com/swaggo/[email protected]/cmd/swag/main.go:45 +0x2ea
    github.com/urfave/cli.HandleAction(0x8fc7a0, 0x9c7fc0, 0xc00022e2c0, 0xc00022e2c0, 0x0)
    	/root/pkg/mod/github.com/urfave/[email protected]/app.go:523 +0xbe
    github.com/urfave/cli.Command.Run(0x9a386f, 0x4, 0x0, 0x0, 0xc0002ed5b0, 0x1, 0x1, 0x9a9ff1, 0xe, 0x0, ...)
    	/root/pkg/mod/github.com/urfave/[email protected]/command.go:174 +0x521
    github.com/urfave/cli.(*App).Run(0xc0000941c0, 0xc000088150, 0x3, 0x3, 0x0, 0x0)
    	/root/pkg/mod/github.com/urfave/[email protected]/app.go:276 +0x729
    main.main()
    	/root/pkg/mod/github.com/swaggo/[email protected]/cmd/swag/main.go:93 +0x65d
    

    The annotation are as follows

    import "k8s.io/api/core/v1"
    // @Success 200 {object} v1.ConfigMap
    

    Your swag version swag version v1.6.3

    Your go version go version go1.12.7 linux/amd64

    opened by nfyxhan 18
  • Version 1.6.9 - cannot find type definition

    Version 1.6.9 - cannot find type definition

    Go version : 1.15.2 (1.15.3 gives installation error) Swag version: 1.6.9

    Error : ParseComment error in file app/services/api/v1/models.go :cannot find type definition: models.ResponseType

    Import: import models "rest-api/app/models/api/v1"

    Usage : // @Failure 400 {object} models.ResponseType

    This works fine on version 1.6.8.

    opened by berayb 17
  • Can't install swag

    Can't install swag

    Describe the bug I'm unable to install swag given the instructions on the README

    To Reproduce Steps to reproduce the behavior:

    1. Execute go get github.com/swaggo/swag/cmd/swag on the command line
    2. See the following error:
    go get github.com/swaggo/swag/cmd/swag
    # github.com/ghodss/yaml
    ./yaml.go:102:28: undefined: yaml.UnmarshalStrict
    
    1. Try to run swag
    2. See the following error:
    zsh: command not found: swag
    

    Expected behavior swag should be installed properly on my machine.

    Desktop (please complete the following information):

    • OS: macOS High Sierra
    • Version: go version go1.10.3 darwin/amd64

    @pei0804

    question 
    opened by johanndiedrick 17
  • this line panic on parsing

    this line panic on parsing

    https://github.com/swaggo/swag/blob/abf4f7b6b2877ebff42dcef5d7a4d2138ca4e8bc/parser.go#L135

    panic: ParseComment panic:Can not find ref type: ... with a type from another package of the form MyStructs.TheStructToUse

    I don't get why .... Stéphane

    help wanted 
    opened by pilere 17
  •  :cannot find type definition: CreateItemResponse true - type in same file/package

    :cannot find type definition: CreateItemResponse true - type in same file/package

    Describe the bug I have the following code:

    // CreateItemRequest -
    type CreateItemRequest struct {
    	Name            string                 `json:"name"`
    	Characteristics map[string]interface{} `json:"characteristics"`
    	Price           int32                  `json:"price"`
    }
    
    // CreateItemResponse -
    type CreateItemResponse struct {
    	ID              string                 `json:"id"`
    	Name            string                 `json:"name"`
    	Characteristics map[string]interface{} `json:"characteristics"`
    	Price           int32                  `json:"price"`
    }
    
    // CreateItem -
    // @Summary     Create a new inventory item
    // @Description Create a new inventory item
    // @Tags        items
    // @Accept      json
    // @Produce     json
    // @Param       item body     CreateItemRequest  true "Item to create"
    // @Success     201  {object} CreateItemResponse true "Item created"
    // @Failure     422  {object} APIError
    // @Failure     406  {object} APIError
    // @Router      /items [post]
    func (c *Controllers) CreateItem(ctx *fiber.Ctx) error {
        ...
    }
    

    When I run: swag init --parseDependency --parseInternal - I get:

     :cannot find type definition: CreateItemResponse true
    

    I've tried a few different suggestions from various issues etc. But nothing seems to work, unfortunately.

    Your swag version v1.8.6

    Your go version go version go1.18.1 darwin/arm64

    Desktop (please complete the following information):

    • Mac OSX M1 - Monterray 12.04
    opened by EwanValentine 1
  • Error while generating doc

    Error while generating doc

    Describe the bug when running following code, it's throwing error

    swag init --md ./docs --parseInternal  --parseDependency --parseDepth 2 -g main.go
    

    image

    Your swag version 1.8.5

    Your go version e.g. 1.19

    opened by sujit-baniya 4
  • Self referenced struct fields types in custom structs

    Self referenced struct fields types in custom structs

    I am a newbie and trying to create and API docs for frontend developer everything is going well so far but i am stuck at a point where my struct has a field whose type is same as paret's type and struct looks like this

    type tag struct {
    	ID       string    `json:"id"`
    	Name     string    `json:"name"`
    	Children []tag `json:"children"`
    }
    

    while Children is of type tag so when i try to create swagger docs swago translate childern as slice of string:, produced docs looks like this:

    [
       {
          "children":[
             "string"
          ],
          "id":"string",
          "name":"string"
       }
    ]
    

    as you can see children is slice of string.

    i tried --parseDependency but it fails and give invalid memory address or nil pointer dereference.

    Then i tried swaggertype:"array,object" which works but does not produce fields name which also makes sense because swager type is array of objects and looks like this:

    [
       {
          "children":[
             {} // object's fileds missing.
          ],
          "id":"string",
          "name":"string"
       }
    ]
    

    My question is: is it possible to translate childern in such a way we can define object type ?

    opened by taalhach 1
  • Generics from 1.18 not working

    Generics from 1.18 not working

    I'm using a package https://github.com/samber/do to implement DI in my project. This package uses at least 1.18 and generics. And when I'm trying to swag init --pd it doesn't work.

    cd cmd/api && swag fmt && swag init --pd
    2022/09/06 20:13:23 Formating code.... 
    2022/09/06 20:13:23 Format API Info, search dir:./
    2022/09/06 20:13:24 Generate swagger docs....
    2022/09/06 20:13:24 Generate general API Info, search dir:./
    2022/09/06 20:14:13 ParseFile error:/Users/weijinnx/go/pkg/mod/github.com/samber/[email protected]/di.go:5:13: expected '(', found '[' (and 10 more errors)
    

    In this di.go:5:13:

    Знімок екрана 2022-09-06 о 20 20 13
    opened by weijinnx 8
  • crash on version 1.8.5 when running 'swag init --parseDependency'

    crash on version 1.8.5 when running 'swag init --parseDependency'

    hi, i found a bug content as follows

    swag init --parseDependency 2022/09/06 21:11:42 Generate swagger docs.... 2022/09/06 21:11:42 Generate general API Info, search dir:./ panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x102814d20]

    goroutine 1 [running]: github.com/swaggo/swag.(*PackagesDefinitions).parseFunctionScopedTypesFromFile(0x1400000e858, 0x14001732880, {0x1400037d8f0, 0x15}, 0x140026b3ad0) go/pkg/mod/github.com/swaggo/[email protected]/packages.go:168 +0x90 github.com/swaggo/swag.(*PackagesDefinitions).ParseTypes(0x1400000e858) go/pkg/mod/github.com/swaggo/[email protected]/packages.go:110 +0xa0 github.com/swaggo/swag.(*Parser).ParseAPIMultiSearchDir(0x140001b42a0, {0x140001da0b0?, 0x1?, 0x0?}, {0x10283f25a?, 0x7?}, 0x64) go/pkg/mod/github.com/swaggo/[email protected]/parser.go:362 +0x29c github.com/swaggo/swag/gen.(*Gen).Build(0x140001ad980, 0x140001aeea0) go/pkg/mod/github.com/swaggo/[email protected]/gen/gen.go:177 +0x4a0 main.initAction(0x140001418c0?) go/pkg/mod/github.com/swaggo/[email protected]/cmd/swag/main.go:151 +0x654 github.com/urfave/cli/v2.(*Command).Run(0x14000000fc0, 0x140001c6340) go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:163 +0x4fc github.com/urfave/cli/v2.(*App).RunContext(0x1400011d6c0, {0x1029f5630?, 0x140000300b8}, {0x140000201b0, 0x3, 0x3}) go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:313 +0x860 github.com/urfave/cli/v2.(*App).Run(...) go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:224 main.main() go/pkg/mod/github.com/swaggo/[email protected]/cmd/swag/main.go:221 +0x65c

    opened by sunrui 16
Releases(v1.8.6)
  • v1.8.6(Sep 17, 2022)

    Changelog

    bc895ed Fix formatting crosstalk (#1317) c9385a8 build a docker image and push to ghcr.io (#1329) 5fbb18f chore: update version (#1330) cf1c4a7 fix: Generic Fields does not handle Arrays (#1311) b8f53da fix: Generic Fields does not handle Arrays in the .swaggo file (#1322) 2cd7ab5 fix: Generics not detected if name does not contain a pkg path (#1328) 007219f fix: funcDeclaration body check (#1310) e7ccdf4 refactor func splitStructName (#1313)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.8.6_Darwin_x86_64.tar.gz(3.93 MB)
    swag_1.8.6_Linux_aarch64.tar.gz(3.49 MB)
    swag_1.8.6_Linux_i386.tar.gz(3.62 MB)
    swag_1.8.6_Linux_x86_64.tar.gz(3.80 MB)
  • v1.8.5(Aug 25, 2022)

    Changelog

    2f148dd Extended generics support (#1277) 23661ef chore: set CGO_ENABLED=0 for goreleaser to avoid dynamic linking (#1293) 732c087 doc: add function scoped struct declaration example (#1296) 45f01a1 feat: add function scoped struct parse (#1283) cf03796 feat: get swagger instance from register (#1298) af1c525 fix: Go generics cannot find common package object type definition (#1281) 9d34a76 fix: Nested generic fields not fully working, if generic type is from… (#1305)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.8.5_Darwin_x86_64.tar.gz(3.93 MB)
    swag_1.8.5_Linux_aarch64.tar.gz(3.48 MB)
    swag_1.8.5_Linux_i386.tar.gz(3.62 MB)
    swag_1.8.5_Linux_x86_64.tar.gz(3.80 MB)
  • v1.8.4(Jul 19, 2022)

    Changelog

    bd21bb0 Fix issue https://github.com/swaggo/swag/issues/1150 (#1248) 401e414 doc: add missing web frameworks (#1263) a566490 feat: add default description to code if none is provided (#1239) a780e45 feat: default required option for struct fields (#1181) 213f6b8 feat: permit error (and any) interface definition (#1212) 89c61d4 feat: suppress debug logs when using -q (#1254) 0e2ec6c feat: use early overrides to allow converting unsupported types. (#1209) 1cd0b53 fix: don't skip ".." directory (#1238) 8de9952 fix: generic arrays generate successfully (#1247) 796a346 fix: temp dir to be the same as SerchDir to avoid invalid cross-device link (#1203) (#1241)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.8.4_Darwin_x86_64.tar.gz(3.92 MB)
    swag_1.8.4_Linux_aarch64.tar.gz(3.48 MB)
    swag_1.8.4_Linux_i386.tar.gz(3.61 MB)
    swag_1.8.4_Linux_x86_64.tar.gz(3.81 MB)
  • v1.8.3(Jun 16, 2022)

    Changelog

    f09eaa1 chore: cleanup generics_test.go (#1231) b736c5f chore: increment version (#1230) e767abb chore: refactor parser (#1191) 5f6b402 feat: Improve performance when generating spec with external dependencies (#1108) 3b580a0 feat: add --quiet=true for swag init, make the debug logger quiet. (#1206) ff41d9c feat: add basic generics support (#1225) 3cedab9 fix: README_zh-CN.md translate bug (#1202) 67cb768 fix: array enum varnames in arrays (#1187)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.8.3_Darwin_x86_64.tar.gz(3.92 MB)
    swag_1.8.3_Linux_aarch64.tar.gz(3.48 MB)
    swag_1.8.3_Linux_i386.tar.gz(3.61 MB)
    swag_1.8.3_Linux_x86_64.tar.gz(3.80 MB)
  • v1.8.2(May 14, 2022)

    Changelog

    c7cb3fd chore: update @Produce comments (#1196) 36ae7af chore: remove gomonkey dependency from formatter (#1192) 47d5a76 chore: updating dependencies (#1190) 5f6c5f8 impr: add param example to readme (#1189) 636f456 chore: improve code quality (#1184) 90170b9 chore(deps): bump github.com/swaggo/http-swagger in /example/markdown (#1185) d209f71 added security definition description (#1174)

    Source code(tar.gz)
    Source code(zip)
    swag_1.8.2_checksums.txt(480 bytes)
    swag_1.8.2_darwin_amd64.tar.gz(9.07 MB)
    swag_1.8.2_darwin_arm64.tar.gz(9.03 MB)
    swag_1.8.2_linux_386.tar.gz(8.76 MB)
    swag_1.8.2_linux_amd64.tar.gz(8.94 MB)
    swag_1.8.2_linux_arm64.tar.gz(8.58 MB)
  • v1.8.1(Mar 30, 2022)

    Changelog

    69245e5 chore: update description.markdown description (#1167) 050b0aa chore: update version.go (#1169) add313f doc: security or documentation (#1158) 32b2467 feat: Example/SchemaExample: allow \r \n \t (#1156) 7dc2340 feat: Feature security or documentation (#1157) 6686f54 feat: [security] feature add or-option (#1151) 334111b feat: add option to set the example to schema #1140 (#1148) 957b087 feat: fix go 1.18 errors caused by any type (#1168) 2b64f78 fix https://github.com/swaggo/swag/issues/1154 (#1161) 9205937 fix: README_zh-CN.md broken link (#1153)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.8.1_Darwin_x86_64.tar.gz(3.66 MB)
    swag_1.8.1_Linux_aarch64.tar.gz(3.25 MB)
    swag_1.8.1_Linux_i386.tar.gz(3.28 MB)
    swag_1.8.1_Linux_x86_64.tar.gz(3.54 MB)
  • v1.8.0(Feb 22, 2022)

  • v1.7.9(Feb 3, 2022)

    Changelog

    b0cdfd4 build: update go directive in go.mod to 1.17 (#1089) 7137cd8 chore: drop support for go 1.14 (#1111) a8ef569 chore: field tags constants (#1088) 808bde6 chore: improve unit tests (#1123) e969efb chore: release v1.7.9 cae7467 feat: Generated file name from instanceName (#1112) 44c3853 feat: add example parameter (#1122) 32f02b9 feat: add generation of type description to schema (#708) (#1106) 97ea98e feat: allow generating of specific docs files only (#577) b1e10b7 feat: instance name func to doc file (#1116) e1ac437 feat: struct fields allow empty example strings (#1125) a7065ad feat: support global type overrides (#1059) 8ffc6c2 fix: undefined httputil and model (#1099)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.7.9_Darwin_x86_64.tar.gz(3.65 MB)
    swag_1.7.9_Linux_aarch64.tar.gz(3.24 MB)
    swag_1.7.9_Linux_i386.tar.gz(3.28 MB)
    swag_1.7.9_Linux_x86_64.tar.gz(3.54 MB)
  • v1.7.8(Dec 24, 2021)

    Changelog

    00a256c Remove unnecessary check (#1073) 4f32ae6 chore: drop support go 1.13 (#1069) f631188 chore: improve code quality (#1086) 9766b4c chore: fix broken go.mod (#1090) 557e1c6 chore: release 1.7.7 (#1087) 75e9d01 chore: remove duplicate walk func (#1070) 9d81576 feat: add separate x-enum-varnames tag (#1083) a7065ad feat: support global type overrides (#1059) 231fa42 fix: allways init response header map at first. (#1066) 54c9ff9 fix: assignment to entry in nil map with @Header all #1082 (#1085) d333316 fix: documentation fix formatter link (#1079) 47d0cd2 fix: parsing panics on default response (#1068)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.7.8_Darwin_x86_64.tar.gz(3.65 MB)
    swag_1.7.8_Linux_aarch64.tar.gz(3.24 MB)
    swag_1.7.8_Linux_i386.tar.gz(3.27 MB)
    swag_1.7.8_Linux_x86_64.tar.gz(3.54 MB)
  • v1.7.6(Nov 26, 2021)

    Changelog

    e59f457 chore: fix bug and refactor (#1048) 60fc849 chore: improve code quality (#1049) 8d7941e chore: improve code quality (#1050) 305a5cf chore: increment version (#1062) 819d929 chore: security fix for github.com/gin-gonic/gin < 1.7.0 (#1060) c21181a chore: version 1.7.5 (#1061) 93acd2a feat: add command for format the swag comment. (#1056) 69fd233 feat: add compatibility with HL7 FHIR standard (#1055) 1780cd2 feat: support arrays in path and header params (#1039) 5237c6d feat: support go-playground/validator tags. (#1045) eff27cc feat: support replace FieldParser (#1043) c4ae822 fix: typo error in README.md (#1057) 9b23c9e improve code quality (#1047) b5ca0bb wrap $ref in allOf when readonly is set (#1034)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.7.6_Darwin_x86_64.tar.gz(3.65 MB)
    swag_1.7.6_Linux_aarch64.tar.gz(3.24 MB)
    swag_1.7.6_Linux_i386.tar.gz(3.27 MB)
    swag_1.7.6_Linux_x86_64.tar.gz(3.53 MB)
  • v1.7.4(Oct 25, 2021)

    Changelog

    bcbae0f Add multipleOf field to parser. (#1008) 9981d9f Auto parse external models when flag parseDependency is set (#1027) 0aac069 Fix link in Chinese introduction (#1005) 271d4d2 add parameter documentation for #1022 (#1023) 18b2bd1 allow multiple Swagger documents (#1022) 732ca2c clarify @accept ussage (#1025) 1a4da01 feat: add extensions for params (#789) f9645be fix @x-tagGroups (#1010) 7ed539e release v1.7.4 (#1036) 9fb19d0 root level accept/produce params (#1011) 0548f60 text/plain allowed in request body (#1029)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.7.4_Darwin_x86_64.tar.gz(3.63 MB)
    swag_1.7.4_Linux_aarch64.tar.gz(3.22 MB)
    swag_1.7.4_Linux_i386.tar.gz(3.25 MB)
    swag_1.7.4_Linux_x86_64.tar.gz(3.51 MB)
  • v1.7.3(Sep 24, 2021)

    Changelog

    497e6e2 correctly parse format on array fields (#973) 0616cef handle *ast.InterfaceType as any type 523e046 add install doc for go 1.17 (#992) eef90d0 add support for empty response (#989) a76cfa3 debug info should go to stdout instead of stderr (#990) 0bbefcf improve unit tests (#981) fd74bcf refactor and lint code (#978) 485f917 support boolean false value in extension (#927) 800fc06 release v1.7.3 (#1007)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(388 bytes)
    swag_1.7.3_Darwin_x86_64.tar.gz(3.58 MB)
    swag_1.7.3_Linux_aarch64.tar.gz(3.18 MB)
    swag_1.7.3_Linux_i386.tar.gz(3.21 MB)
    swag_1.7.3_Linux_x86_64.tar.gz(3.47 MB)
  • v1.7.1(Aug 11, 2021)

    Changelog

    17c1766 Add an example of add a description for enum items (#895) 60ec167 Add support to specify multiple routes for the same function (#957) fd504eb Added support for @x- attributes on security definition (#971) 95a0837 Chore(readme): update travis-ci link (#958) b69dfd8 Fix the goreportcard-cli output error (swaggo#872) (#873) 505d4f1 Handle duplicate route declaration better (#968) cb2bdb6 Improve test coverage and code readability. (#967) e8632e2 Support enums on array parameters (#919) 6f2abdd Support quotes and tabs in general API description (#743) 98b8c70 Update examples.go (#832) 3d90fc0 change the regular expression to fix the issue #853 caused by PR #837 (#854) 2d00d57 chore(deps): bump github.com/gin-gonic/gin (#959) 65cccd7 chore(deps): bump github.com/gin-gonic/gin in /example/go-module-support (#961) 19e5237 chore: alecthomas/template -> text/template (#891) e7c5cda fix breaking change introduced in go-openapi/spec v0.20.3 (#890) 4dda7e3 fix buil issue on #743 due to wront expected.json (#966) 0ab714a fix gen_test.go (#960) ff52371 fix security link (#963) f2f643a provide example and enum values when reporting unsupported type (#921) b19e9cf release v1.7.1 (#974) 4924b43 security update for ithub.com/gin-gonic/gin (#962) c71655d support searching multiple directories (#944) 6be354d update documentation regarding go version (#914)

    Source code(tar.gz)
    Source code(zip)
    swag_darwin_amd64.tar.gz(3.66 MB)
    swag_linux_386.tar.gz(3.27 MB)
    swag_linux_amd64.tar.gz(3.54 MB)
    swag_linux_arm64.tar.gz(3.18 MB)
  • v1.7.0(Dec 7, 2020)

    Changelog

    ee29e2b Add go.mod to example/celler (#838) 031a42d Optional second parameter when using object in swaggertype (#844) e18fc86 Release swag for Linux/ARM64 (#842) 7fdbe7a Update dep latest github.com/swagger/gin-swagger (#819) 2ca4d38 Update dependencies and fix tests (#835) 62e4d9b Update go.mod (#839) a4053fb chore: release v1.7.0 (#849) 09f9621 feature: support default response, use comma-separated codes to add a… (#837) c9056f0 issue-503: added type map in example value (#683) 3d083d3 refactor: remove dependency on gin (#800) 3f47d68 update dep latest swaggo/gin-swagger (#825) 88888c5 upgrade spec package and simplify code (#836)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(484 bytes)
    swag_1.7.0_Darwin_i386.tar.gz(3.74 MB)
    swag_1.7.0_Darwin_x86_64.tar.gz(3.91 MB)
    swag_1.7.0_Linux_aarch64.tar.gz(3.45 MB)
    swag_1.7.0_Linux_i386.tar.gz(3.59 MB)
    swag_1.7.0_Linux_x86_64.tar.gz(3.75 MB)
  • v1.6.9(Oct 20, 2020)

  • v1.6.8(Oct 15, 2020)

    Changelog

    6a59a20 Add ability to set 'swaggerignore' on embedded fields (#779) 366e536 Add operationId uniqueness check (#732) 542e932 Correct typos in README (#773) cbfd47b Don't generate docs for nested structs without fields (#752) e769bbe Fix typos in maximum/minimum attributes (#762) 1889a3a Ignore swag file from root dir only (#775) 33e4ac3 chore(travis): support go1.15 (#787) b712c54 feat: add parse depth flag (#766) 3ce6eb2 feat: generate formData params via go struct (#770) a72dff0 fix README_zh-CN typo (#744) 01fb318 fix x-logo vendor extension & parse x-codeSamples from files (#760) d8893d0 fix: don't generate license field if it's empty (#768) 940d072 fix: fmt check lint (#740) 6937d1c fix: honor x-order while sorting query parameters (#806) 4a18bc9 fix: primitive type of param in body; use const string for type (#734) 80b6894 fix: replace unsupported and vulnerable satori/go.uuid with gofrs/uuid (#798) b28321d parseDepth flag readme (#769) 1868a02 readme: add absent annotation (#733) c5fb1a1 refactor: fix more than one models have the same the from different packages (#736) 67cb097 refactor: build spec.Schema; parse object in request (#728) ec7a5ee stable renaming to fix issue #745; uncapitalize tow members of parser (#746)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.6.8_Darwin_i386.tar.gz(3.73 MB)
    swag_1.6.8_Darwin_x86_64.tar.gz(3.90 MB)
    swag_1.6.8_Linux_i386.tar.gz(3.58 MB)
    swag_1.6.8_Linux_x86_64.tar.gz(3.74 MB)
  • v1.6.7(Jun 4, 2020)

    Changelog

    df54d45 Add --parseInternal flag to support internal underlying types (#508) cbe4f50 Merge branch 'master' into fix-short-aliases-flag-is-not-working 59734e3 Merge branch 'master' into fixed-query-order 2b0d62a Merge branch 'master' into fixed-query-order 9307fce Merge branch 'master' into internal-package-parsing-support f63189d Merge branch 'master' into internal-package-parsing-support 89a93be Merge branch 'master' into master 80a9996 Merge pull request #509 from paulcamper/internal-package-parsing-support c7982e6 Merge pull request #681 from breeswish/fixed-query-order 7c765dd Merge pull request #706 from danielpoe/master a5d963c Merge pull request #713 from swaggo/fix-short-aliases-flag-is-not-working 581308b Merge pull request #714 from comphilip/master 3f54376 Override deep-level fields in request body object 719cfd8 Sort query parameters generated from object d4a9b4b Update main.go 6a1781e chore(README): add fiber-swagger repo link 51088c1 chore(README): Add required docs to README.md (#703) df209af chore: jump to v1.6.7 (#725) c03e213 fix code checking 16c21c4 fix code checking error and fix #717 271cf8f fix: short aliase flag is not working fca3878 mention flamingo framework support e72e13e readme: adjust flag

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.6.7_Darwin_i386.tar.gz(3.97 MB)
    swag_1.6.7_Darwin_x86_64.tar.gz(4.17 MB)
    swag_1.6.7_Linux_i386.tar.gz(3.80 MB)
    swag_1.6.7_Linux_x86_64.tar.gz(3.98 MB)
  • v1.6.6(May 24, 2020)

    Changelog

    0937fc4 Add Chinese translation of readme #695 38f619b Add Chinese translation of readme #695 2107ee2 Add documents in README.md 4922334 Add ref link in README.md ccc5ab2 Added Dockerfile (#671) 1e6c432 Added unit test for cgo package import c0c2ff8 Correct translation c6d9620 Examples: Fix doc typos in accounts. 87eac7e Fix dataTypeFormatlink link. (#614) e1b41ed Fix make lint and make fmt-check 577f62e Issue #225 12801d5 Issue #225 51c115b Issue #225 ec7b993 Issue #225 4701737 Merge branch 'master' into feat/cgo d5a5130 Merge branch 'master' into feat/cgo bb8f590 Merge branch 'master' into feat/cgo aff959e Merge branch 'master' into fix-665-json-strings a1ce1cc Merge branch 'master' into master aaba525 Merge branch 'master' into master 6f65efc Merge branch 'master' into master a62d23a Merge branch 'master' into master a7bae01 Merge branch 'master' into master eb365f7 Merge branch 'master' into master 132eace Merge branch 'master' into nested_schema 5cd03f0 Merge pull request #629 from wsnotify/issue-225 8e8a052 Merge pull request #643 from thylong/docs/fix-typos 8e21f4c Merge pull request #651 from whunmr/nested_schema ac5b59a Merge pull request #660 from poccariswet/master 86f9d9c Merge pull request #662 from MaitreDede/feat/cgo 3ebb56e Merge pull request #668 from ShoshinNikita/master dc90151 Merge pull request #675 from tcarreira/master 93e5f15 Merge pull request #677 from tcarreira/fix-665-json-strings 7c58d34 Merge pull request #697 from Promacanthus/readme_zh-cn e07798f Merge pull request #701 from Turing-Chu/master 593555a Overriding deep-level fields in response object (#672) 51a9215 Reflect optional output directory in the generated docs.go (#617) 3cafd99 Revert "cleanup : removed unused source" ecf0baa Support Model Composition in Response with allOf and ref 2f74ff2 Support colletionFormat for array params in query; Exclude directories and files (#642) 366d393 Update README_zh-CN.md a7e0180 Update parser.go c9d332d Update parser.go 2c8dd22 Update property.go e10c4d7 [FIX] parse comment error integer to string c168a63 added markdwon files to single modules (#630) be7ef6b chore(travis): add go 1.14 test (#633) de5290b chore: add go1.13 support (#613) 4508062 chore: drop go1.11&1.12 ci (#710) d8a6d4a chore: jump to v1.6.6 (#704) 070af50 cleanup : removed unused source ca3ddd8 code optimization 86e76b7 feat: migrate to using/urfave/cli/v2 (#618) 4676cb1 feat: add tag 'swaggerignore' to exclude a field from struct (#635) 7290e9b feat: support renaming model to display in swagger UI (#631) 6fb2a2d fix TestParseNonExportedJSONFields f150c13 fix: add code to handle and skip structs with "func" fields. (#616) 3b82b47 issue 650: fix integer bug in response; support multi fields overriding. (#655) fa78550 issue-665: fix example when using json=",string" 187ec48 optimize 5ba88c8 optimize a4c0f6d optimize 5fcb6d5 parseField skips not-exported (encoding/json-like) 5b6f1b7 simplified cgo test b9554c4 skip cgo package b35892a support embedded structures with alias instead of package name 4c502aa testdata/alias_import: add test for embedded field

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.6.6_Darwin_i386.tar.gz(3.95 MB)
    swag_1.6.6_Darwin_x86_64.tar.gz(4.16 MB)
    swag_1.6.6_Linux_i386.tar.gz(3.79 MB)
    swag_1.6.6_Linux_x86_64.tar.gz(3.98 MB)
  • v1.6.5(Jan 11, 2020)

  • v1.6.4(Jan 5, 2020)

    Changelog

    bef48a6 Add generated time flag (#501) ab69c23 Fix some typos (#543) 8cedf42 Fix: Use of go primitive array type in body give error (#593) 68ab45d add support for map nested in struct (#521) d6d8b49 chore(CI): add GitHub action (#571) 008c37b chore(refactor): improve code quality (#540) de444e5 chore: add GitHub action (#568) b564023 chore: correcting the comet (#555) 10630b9 feat: optimize getArrayPropertyName; support [][]string fixing #562 (#588) 0e5dd7d feat: support array of maps (#586) 74d6d6c feature: extend struct's simple members in query comment (#594) b731715 fix bug in array param in body (#579) b734f40 fix issue with import aliases (#483) (#573) 75ecf95 fix issue with urfave/cli (#557) 6d49876 fix(githubCI):working directory issue. (#580) 549622f fix: body object without package name in param comments use default package name (#591) 73e3f31 fix: change the condition for checking custom arrayType (#590) eb4805c fix: fully support map and optimization (#583) c05c273 fix: required tag doesn't work with nested object property #504 (#541) fb06668 fix: router now support colon sign. Useful for custom methods using custom verbs (#552) 6567f07 fix: unnecessary type field in parameter body schema 95cdaaf jump to v1.6.4 (#597)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.6.4_Darwin_i386.tar.gz(3.95 MB)
    swag_1.6.4_Darwin_x86_64.tar.gz(4.15 MB)
    swag_1.6.4_Linux_i386.tar.gz(3.78 MB)
    swag_1.6.4_Linux_x86_64.tar.gz(3.97 MB)
  • v1.6.3(Sep 28, 2019)

    Changelog

    5c2a121 Changed from strings.ReplaceAll to strings.Replace b09d3f5 Correct error in checking for primitive data type (#516) d74ed70 Fix nested struct parsing (#514) 1c38154 Fixed JSON issue with Multiline API Description 9710e4b Improved error message, when a markdown file is missing … (#491) c2f6613 Merge pull request #481 from lonnblad/programmatic-multiline-api-description 16ebb32 Merge pull request #492 from swaggo/update-go-mod 77b9020 chore: add docs.go test coverage (#482) 3d60281 chore: add markdown example (#486) 4f5a434 chore: improve test coverage (#448) c9f403a chore: jump version to v1.6.3 (#531) e0c8bbb chore: use github action (#528) 7c7bb14 delete deps e97b3a0 doc(readme): additional Example for swaggertype (#498) 33a7940 exclude developer tools from go modules. (#493) e22b392 feat(parser): support slice of primitives for query and body, support primitives for body (#489) be88a64 feat: embeded struct not parsed (#463) 4642ffd feat: support @x- attributes for operations (#452) bd1235d fix code coverage in operation.go (#456) 6de832a fix: dynamic schemes bugfix (#450) c19280e fix: error resolving host and basepath (#475) 72f30f8 fix: support anonymous nested structure slice parsing (#462) d8cb1c8 fix: unnecessary type field on response objects (#459) 67075e4 refactor(gen.go): improve code coverage (#468) 8743381 refactor: reduce code complexity (#487) efcfb3d support for read only, test by adding read only attribute to id of pet (#529) 4f860d7 tag.docs.description typos (#500)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.6.3_Darwin_i386.tar.gz(3.93 MB)
    swag_1.6.3_Darwin_x86_64.tar.gz(4.14 MB)
    swag_1.6.3_Linux_i386.tar.gz(3.77 MB)
    swag_1.6.3_Linux_x86_64.tar.gz(3.96 MB)
  • v1.6.2(Jul 10, 2019)

    Changelog

    52091f1 chore: release v1.6.2 (#447) 288d21c enhancement: remove backticks from struct field's comment (#442) 9fbf26c feat: ability to set "schemes" programatically (#438) be6d0b2 fix: only execute 'go list' when enable 'parseDependency' flag (#439) c8a5281 fix: variables in the assignment caused compile error (#446)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.6.2_Darwin_i386.tar.gz(3.72 MB)
    swag_1.6.2_Darwin_x86_64.tar.gz(3.92 MB)
    swag_1.6.2_Linux_i386.tar.gz(3.56 MB)
    swag_1.6.2_Linux_x86_64.tar.gz(3.74 MB)
  • v1.6.1(Jul 6, 2019)

  • v1.6.0(Jul 2, 2019)

    Changelog

    afb3de9 chore(mod): remove gin dependence (#424) e868ec0 chore: fix example comment at ParseParamComment func 393e5cc chore: release v1.6.0 (#430) 593e936 feat: add option to explicitly include or exclude third party dependencies (#426) b534de4 feat: added deprecation parsing (#410) 11619ac feat: found declarative annotations from go-module packages (#415) e3192f3 feat: implement parsing extension on root level openapi (#416) 6170d1b feat: support markdown description (#377) d2e27a2 fix: don't need to parse sub package when found dependencies (#425) 016b87b fix: ignore .go files in 'testdata' folder because it can be invalid (#418) 6ee61d7 refactor: added some error checks (#411)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.6.0_Darwin_i386.tar.gz(3.71 MB)
    swag_1.6.0_Darwin_x86_64.tar.gz(3.91 MB)
    swag_1.6.0_Linux_i386.tar.gz(3.56 MB)
    swag_1.6.0_Linux_x86_64.tar.gz(3.73 MB)
  • v1.5.1(Jun 12, 2019)

    Changelog

    8e9b978 Fix processing alias type in struct when alias type is in another package (#403) 31a3c5a chore(assets): update swaggo png (#408) 03e66e6 chore(doc): fix cli desc (#364) 783d9d5 chore(mod): leave only build dependencies (#405) e1d2304 chore(readme): add Go version at go get paragragh (#361) b5d2fa7 chore(readme): add release badge (#394) 6b0801b chore(readme): fixed link into readme (#363) 169765a chore(readme): make swaggertype examples more readable (#371) 7c1ce37 chore: fix repair bug_report.md to one standard (#366) f7df9bf chore: release v1.5.1 (#409) 2a7b9f4 doc(readme): fix Param Type option desc (#383) 7a85a26 fix(example): fix typos in UploadAccountImage message (#401) 32df12c fix(property): remove warning (#393) fa508ff refactor: return error instead of panic (#399)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.5.1_Darwin_i386.tar.gz(3.71 MB)
    swag_1.5.1_Darwin_x86_64.tar.gz(3.90 MB)
    swag_1.5.1_Linux_i386.tar.gz(3.55 MB)
    swag_1.5.1_Linux_x86_64.tar.gz(3.72 MB)
  • v1.5.0(Mar 26, 2019)

    Changelog

    93d87f4 Add license scan report and status (#324) c5b05a6 Added backers and sponsors on the README (#315) 0d4d8f5 Fix handling of multiline description blocks when general API is in the same file as operations (#340) (#341) 20de40e Revert "chore: update gin-swagger examples and doc (#345)" (#346) b6a3401 Support parse definition in vendor, for issues/242 (#331) 7fc8833 add support for 1.12.x and update make install (#342) a5009d0 bump to v1.5.0 (#358) 4f45ba5 chore(makefile): add formats check (#317) c9cee45 chore(makefile): use Immediate set (#333) e98d7d1 chore(mod): add missing modules (#321) aabc056 chore: add release page link (#310) ea26d9e chore: realign readme (#309) 7b98fb8 chore: update gin-swagger examples and doc (#345) 622e072 chore: update issue template for bug report (#334) 6163333 doc(readme): update README for parseVendor in cli section (#332) 9161028 feat: add output flag to specify output dir (#325) 93c4fa2 feat: allow matches any non-whitespace characters in param name (#287) 009de0c feat: and go vet check (#336) 21ed798 feat: don't print log when testing (#311) 266aebc feat: refine schemes tag (#319) e4ec0fe feat: support line-comments to struct comment (#356) 9a22132 fix examples doc link (#349) 889705a fix go lint error (#335) f29f821 fix spelling error in ParseComment (#318) 8183332 fix(doc): fix go report card link (#322) fe1c938 fix(test): fix imported and not used (#320) c4fc758 fix(test): fix misspell (#323) e609757 fix: missing output coverage file (#312) a8247dc fix: swag rejects valid MIME Types for Produce annotation, panic (#304) 3320652 refactor for property.go (#352) 3a5aa94 refactor parseAndExtractionParamAttribute (#354) 788b633 refactor(operation): get more clear to remove else (#347) 92f098d refactor(paser): using error instead of panic (#355) 8c7df8e refactor: Initialize regexp.MustCompile only once (#343) 75f716d refactor: check dir flag and enhance error handling (#307) d21dc4f refactor: extract schema logic (#338) 3335bb4 refactor: return error instead of panic (#350) 4d66fe8 use trim spaced string (#353)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.5.0_Darwin_i386.tar.gz(3.71 MB)
    swag_1.5.0_Darwin_x86_64.tar.gz(3.90 MB)
    swag_1.5.0_Linux_i386.tar.gz(3.55 MB)
    swag_1.5.0_Linux_x86_64.tar.gz(3.72 MB)
  • v1.4.1(Feb 18, 2019)

    Changelog

    d85ab81 Custom primitive types (#204) cea5516 Fix code example in README (#240) 7e407c1 Multiline description for api info (#278) ba90627 Update README: future is available (#281) 17745a0 add filename info when panic (#272) 700eb94 bump to v1.4.1 (#301) 1c8533a chore(gitignore) prevent cmd/swag/main.go from being ignored (#255) 1048d76 chore: added comment schema.go (#277) d95e114 chore: release via goreleaser (#302) b5bd45e doc(readme): add link to buffalo-swagger (#263) 64ab6b0 doc(readme): update gin link in README.md (#249) ecdf79c feat(tag): implemented basic Tag support as API annotation (#250) 5066057 feat: add extension info to struct field (#295) 7b8e2c6 feat: add mechanism to programatically set general api info (#220) abe5488 feat: add response headers (#297) 56047e6 feat: add support for map and struct pointer types and selector in array pointer (#244) 6993bc5 feat: add support for the attributes in struct fields (#239) 0666acc feat: add support override swaggertype tag especially for self-defined st… (#290) c0507b2 feat: allow overriding swagger type in struct fields (#234) 2864d16 feat: multi description support (#219) dac684d feat: release v.1.4.0 82de8d7 feat: router path now supports plus sign, useful for swagger consuming gateways that want to proxy, like AWS APIGW (#217) a2ee966 feat: support additional typedefs (#246) 6219f1a feat: support for composition objects. (#226) ed5589f feat: support go module (#282) 2a57949 feat: support mapType (#283) ff54974 feat: support numbers in array examples (#233) 7cb5615 fix bug: []map[string]string type will crash (#286) 7d687ac fix(Makefile): golint uses new repo url (#222) 0e12fd5 fix(doc): Fix docs. Title, Description reference in README.md (#262) 934068f fix(example): fix lint (#264) de0fc42 fix(parser): Parser error on composition object across package (#275) 8f09470 fix(parser): fix isNotRecurringNestStruct function (#241) 78c4dff fix: struct order bug (#270) 559d011 fix: bug for required properties inherited (#259) b0e84d8 fix: fix required changing order every time when run swag 73cbe85 fix: missing schema convert (#212) e565d5c fix: translate array type into valid swagger type (#232) fd1af3a refactor: enhance error handle (#206) 4dfb5f3 refactor: returns error instead of panic (#288) 0744535 remove panic in favor of printed warning (#210) 19d1d7a stop supporting go 1.8.x (#228)

    Source code(tar.gz)
    Source code(zip)
    checksums.txt(386 bytes)
    swag_1.4.1_Darwin_i386.tar.gz(3.38 MB)
    swag_1.4.1_Darwin_x86_64.tar.gz(3.56 MB)
    swag_1.4.1_Linux_i386.tar.gz(3.24 MB)
    swag_1.4.1_Linux_x86_64.tar.gz(3.41 MB)
  • v1.4.0(Nov 19, 2018)

    [NEW] support empty response body when only have status code (#163) [NEW] add support cross package (#171) [NEW] support type definitions not found under the search directory (#179) [NEW] support custom primitive types (#198)

    [FIX] always diff in testdata (#168) [FIX] fix invalid response type: array of strings (#173) [FIX] fix to address referencing types in external, vendored pkgs #188 (#189)

    Source code(tar.gz)
    Source code(zip)
  • v1.3.2(Jun 12, 2018)

Owner
Swaggo
Automatically generate RESTful API documentation with Swagger 2.0 for Go
Swaggo
Generate code for any language, with any language.

gocog - generate code for any language, with any language gocog v1.0 build 20130206 Binaries for popular OSes are available on the Downloads page of t

Nate Finch 66 Aug 5, 2022
GAPID: Graphics API Debugger

GAPID: Graphics API Debugger

Google 2.1k Sep 16, 2022
Template project to get started with a simple API skeleton in Go and Docker

A template project to create a Docker image for a Go application. The example application exposes an HTTP endpoint through a REST API packaged as a static binary.

Harsh Mishra 11 Apr 4, 2022
🧬 fiber middleware to automatically generate RESTful API documentation with Swagger

Swagger fiber middleware to automatically generate RESTful API documentation with Swagger Usage Add comments to your API source code, See Declarative

Fiber 82 Sep 23, 2022
crud is a cobra based CLI utility which helps in scaffolding a simple go based micro-service along with build scripts, api documentation, micro-service documentation and k8s deployment manifests

crud crud is a CLI utility which helps in scaffolding a simple go based micro-service along with build scripts, api documentation, micro-service docum

Piyush Jajoo 0 Nov 29, 2021
Swagger-go-chi - Generate a go-chi server from swagger

swagger-go-chi Install go install github.com/cugu/[email protected] Run swagge

Jonas Plum 6 Aug 12, 2022
Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

long2ice 54 Sep 21, 2022
Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

long2ice 54 Sep 21, 2022
📖 Build a RESTful API on Go: Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.

?? Tutorial: Build a RESTful API on Go Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers. ?? The full article is published on Marc

Vic Shóstak 200 Sep 16, 2022
An example repo for RESTful API with swagger docs & unit testing

go REST API An example repo for RESTful API with swagger docs & unit testing Starting development server Copy .env.example to .env in the same directo

Rishabh Pandey 0 Nov 5, 2021
RESTful-JSON-API - RESTful-JSON-API using Go

RESTful-JSON-API using Go This basic REST-API principle establishes a one-to-one

Siddhesh Khandagale 1 Feb 15, 2022
Utilities to generate (reference) documentation for the docker CLI

About This is a library containing utilities to generate (reference) documentation for the docker CLI on docs.docker.com. Disclaimer This library is i

Docker 14 Jun 25, 2022
henrylee2cn 1.6k Sep 16, 2022
go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface

go-whatsapp-rest-API go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface Multi-devices (MD) Support. This ver

null 16 May 13, 2022
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API Server of Clean Architecture Go(echo) gorm mysql docker swagger build docker-compose up -d --build API Postman and Fiddler is recommended to

null 34 May 14, 2022
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API Server of Clean Architecture Go(echo) gorm mysql docker swagger build docker-compose up -d --build API Postman and Fiddler is recommended to

null 303 May 30, 2021
Go WhatsApp REST API Implementation Using Fiber And Swagger

Go WhatsApp REST API Implementation Using Fiber And Swagger Package cooljar/go-whatsapp-fiber Implements the WhatsApp Web API using Fiber web framewor

Mohammad Fajar Rizky 9 May 9, 2022
generated go client for grafanas http api, based on swagger-codegen

Go API client for go_client The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, cre

Jan Willies 0 Dec 2, 2021
A Go API project using Beego(Go Framework) with Swagger UI

Beego_API_with_swagger_UI Descriptions This is a Go API project using Beego(Go F

A.R partha 0 Dec 20, 2021
Godaddy-domains-client-go - Godaddy domains api Client golang - Write automaticly from swagger codegen

Go API client for swagger Overview This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you c

Mickael Stanislas 0 Jan 9, 2022