From 92117aa93c7415b3ebb0fd710cc4cb43e567645e Mon Sep 17 00:00:00 2001 From: Hamza Ali Date: Wed, 9 Sep 2020 22:22:38 +0700 Subject: [PATCH] swagger: add register endpoint --- api/swagger.yaml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/api/swagger.yaml b/api/swagger.yaml index 9095fb1..b3c02e8 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -48,6 +48,31 @@ paths: $ref: '#/components/responses/InvalidToken' 500: $ref: '#/components/responses/ServerError' + /auth/register: + post: + tags: + - Auth Endpoints + summary: Creates a new user account that can be used to participate with the website. + requestBody: + description: The information for the new user. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisteredUser' + responses: + 200: + description: Your account has successfully been created, and you can now log in. + content: + application/json: + schema: + type: object + 400: + $ref: '#/components/responses/MalformedBody' + 401: + $ref: '#/components/responses/InvalidToken' + 500: + $ref: '#/components/responses/ServerError' components: requestBodies: @@ -117,6 +142,28 @@ components: reason: The internal server reached an unknown state. code: 500 schemas: + RegisteredUser: + type: object + required: + - username + - email + - password + properties: + username: + type: string + minLength: 3 + maxLength: 16 + pattern: "[a-zA-Z0-9 ]{3,16}" + description: A Unique uusername to identify a user around the website. + email: + type: string + format: email + description: A Unique email used for communication/further identification. + password: + type: string + format: password + minLength: 8 + maxLength: 32 Token: required: - token