mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2026-05-21 03:10:12 +02:00
docs: add swagger auto generator
* to generate docs, run `make docs` * endpoint /swagger/
This commit is contained in:
@@ -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
15
internal/api/swagger.go
Normal 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
|
||||
Reference in New Issue
Block a user