docs: add swagger auto generator

* to generate docs, run `make docs`
* endpoint /swagger/
This commit is contained in:
2023-04-13 11:55:07 +00:00
parent 0e5db7f06f
commit d51e74883d
11 changed files with 224 additions and 9 deletions

View File

@@ -12,9 +12,13 @@ import (
"github.com/labstack/echo/v4"
)
// CreateAccountHandler route.
// POST: /api/account/create
// Returns the public key.
// HandleAccountCreate godoc
// @Summary Create a new custodial account.
// @Description Create a new custodial account.
// @Accept */*
// @Produce json
// @Success 200 {object} map[string]interface{}
// @Router / [post]
func HandleAccountCreate(cu *custodial.Custodial) func(echo.Context) error {
return func(c echo.Context) error {
generatedKeyPair, err := keypair.Generate()

15
internal/api/swagger.go Normal file
View File

@@ -0,0 +1,15 @@
package api
// @title CIC Custodial API
// @version 1.0
// @description Interact with CIC Custodial API
// @termsOfService https://grassecon.org/pages/terms-and-conditions.html
// @contact.name API Support
// @contact.url https://grassecon.org/pages/contact-us
// @contact.email devops@grassecon.org
// @license.name AGPL-3.0
// @license.url https://www.gnu.org/licenses/agpl-3.0.en.html
// @BasePath /api