Add target for formatting swag docs & formatting swag docs

This commit is contained in:
Imbus 2024-03-08 10:30:17 +01:00
parent b52f13ee8b
commit efc95e7fea
2 changed files with 7 additions and 3 deletions

View file

@ -76,6 +76,10 @@ default: build
docs:
swag init -outputTypes go
.PHONY: docfmt
docfmt:
swag fmt
install-swag:
@echo "Installing swag"
@go get -u github.com/swaggo/swag/cmd/swag

View file

@ -53,9 +53,9 @@ type GState struct {
// @Tags User
// @Accept json
// @Produce json
// @Success 200 {string} string "User added"
// @Failure 400 {string} string "Bad request"
// @Failure 500 {string} string "Internal server error"
// @Success 200 {string} string "User added"
// @Failure 400 {string} string "Bad request"
// @Failure 500 {string} string "Internal server error"
// @Router /api/register [post]
func (gs *GState) Register(c *fiber.Ctx) error {
u := new(types.User)