Swagger UI generator for Echo framework
Go to file
2018-09-04 21:17:46 +08:00
.gitignore Add core logic 2018-09-01 23:18:38 +08:00
.travis.yml Add TravisCI 2018-09-02 09:14:14 +08:00
assets.go Add SetUI & other http methods 2018-09-03 22:52:30 +08:00
converter.go Fix bug of indirect & schema.Example 2018-09-04 20:09:11 +08:00
generator.go Fix bug of indirect & schema.Example 2018-09-04 20:09:11 +08:00
internal_test.go Fix bug of indirect & schema.Example 2018-09-04 20:09:11 +08:00
internal.go Add SetUI & other http methods 2018-09-03 22:52:30 +08:00
LICENSE Initial commit 2018-08-30 21:41:51 +08:00
models.go Add skeleton 2018-08-31 20:47:37 +08:00
README.md Add interface ApiRouter 2018-09-02 10:22:18 +08:00
security_test.go Add test of security 2018-09-04 21:17:46 +08:00
security.go Add core logic 2018-09-01 23:18:38 +08:00
spec_test.go Fix bug of indirect & schema.Example 2018-09-04 20:09:11 +08:00
spec.go Add SetUI & other http methods 2018-09-03 22:52:30 +08:00
tag_test.go Fix bug of indirect & schema.Example 2018-09-04 20:09:11 +08:00
tag.go Fix bug of indirect & schema.Example 2018-09-04 20:09:11 +08:00
utils.go Fix bug of indirect & schema.Example 2018-09-04 20:09:11 +08:00
validator.go Add SetUI & other http methods 2018-09-03 22:52:30 +08:00
wrapper_test.go Add SetUI & other http methods 2018-09-03 22:52:30 +08:00
wrapper.go Add SetUI & other http methods 2018-09-03 22:52:30 +08:00

echoswagger

Swagger UI generator for Echo framework

Go Report Card Build Status codecov

Feature

  • No SwaggerUI html/css dependency
  • Highly integrated with echo, low intrusive design
  • Take advantage of the strong typing language to make it easy to use
  • Recycle garbage in time, low memory usage

Example

package main

import (
	"net/http"

	"github.com/elvinchan/echoswagger"
	"github.com/labstack/echo"
)

func main() {
	// ApiRoot with Echo instance
	e := echoswagger.New(echo.New(), "/v2", "doc/", nil)

	// Routes with parameters & responses
	e.POST("/", createUser).
		AddParamBody(User{}, "body", "User input struct", true).
		AddResponse(http.StatusCreated, "successful", nil, nil)

	// Start server
	e.Echo().Logger.Fatal(e.Echo().Start(":1323"))
}

type User struct {
	Name string
}

// Handler
func createUser(c echo.Context) error {
	return c.JSON(http.StatusCreated, nil)
}