Added default error response documentation
This commit is contained in:
parent
aedb1903f0
commit
e44bb89bd8
@ -27,9 +27,8 @@ import (
|
||||
// @accept json
|
||||
// @produce json
|
||||
// @param register body v1.Register true "alice" "supersecretpassword"
|
||||
// @success 200 {object} models.Token
|
||||
// @failure 400 {object} models.Error "MissingBody | InvalidUsername | InvalidPassword"
|
||||
// @failure 500 {object} models.Error "DatabaseError | InternalServerError"
|
||||
// @success 200 {object} v1.Token
|
||||
// @response default {object} v1.Error "There was an error"
|
||||
// @router /v1/account/login [post]
|
||||
func Login(ctx *context.Context) {
|
||||
// Store body
|
||||
|
@ -27,10 +27,8 @@ import (
|
||||
// @accept json
|
||||
// @produce json
|
||||
// @param register body v1.Register true "alice" "supersecretpassword"
|
||||
// @success 200 {object} models.Token
|
||||
// @failure 400 {object} models.Error "MissingBody | UsernameTaken"
|
||||
// @failure 403 {object} models.Error "RegistrationDisabled"
|
||||
// @failure 500 {object} models.Error "DatabaseError | InternalServerError"
|
||||
// @success 200 {object} v1.Token
|
||||
// @response default {object} v1.Error "There was an error"
|
||||
// @router /v1/account/register [post]
|
||||
func Register(ctx *context.Context) {
|
||||
// Check if registration is disabled
|
||||
|
Loading…
Reference in New Issue
Block a user