Added default error response documentation

This commit is contained in:
perp 2024-06-04 16:31:55 +01:00
parent aedb1903f0
commit e44bb89bd8
2 changed files with 4 additions and 7 deletions

View File

@ -27,9 +27,8 @@ import (
// @accept json // @accept json
// @produce json // @produce json
// @param register body v1.Register true "alice" "supersecretpassword" // @param register body v1.Register true "alice" "supersecretpassword"
// @success 200 {object} models.Token // @success 200 {object} v1.Token
// @failure 400 {object} models.Error "MissingBody | InvalidUsername | InvalidPassword" // @response default {object} v1.Error "There was an error"
// @failure 500 {object} models.Error "DatabaseError | InternalServerError"
// @router /v1/account/login [post] // @router /v1/account/login [post]
func Login(ctx *context.Context) { func Login(ctx *context.Context) {
// Store body // Store body

View File

@ -27,10 +27,8 @@ import (
// @accept json // @accept json
// @produce json // @produce json
// @param register body v1.Register true "alice" "supersecretpassword" // @param register body v1.Register true "alice" "supersecretpassword"
// @success 200 {object} models.Token // @success 200 {object} v1.Token
// @failure 400 {object} models.Error "MissingBody | UsernameTaken" // @response default {object} v1.Error "There was an error"
// @failure 403 {object} models.Error "RegistrationDisabled"
// @failure 500 {object} models.Error "DatabaseError | InternalServerError"
// @router /v1/account/register [post] // @router /v1/account/register [post]
func Register(ctx *context.Context) { func Register(ctx *context.Context) {
// Check if registration is disabled // Check if registration is disabled