Skip to content

EAFCode/swaggergo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generating the swagger documentation with Golang - Product API

Swagger documentation is generated from the code using go-swagger package.

  1. step: Get dependency witch contains a golang implementation of Swagger 2.0
go get -u github.com/go-swagger/go-swagger/cmd/swagger
  1. step: Adding metadata in your code.

  2. step: Generate the file swagger.yaml using the following command:

swagger generate spec -o ./swagger.yaml --scan-models
  1. step: If you want swagger-ui import the package go-openapi in your code
import "github.com/go-openapi/runtime/middleware"
  1. step: running your code:
go run main.go

Swagger documentation can be viewed in your browser at:

swagger-ui:   http://localhost:8080/docs.
swagger-spec: http://localhost:8080/swagger.yaml

see guide

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages