diff --git a/backend/src/bundles/auth/auth.controller.ts b/backend/src/bundles/auth/auth.controller.ts index 148002532..eaf4bb7a3 100644 --- a/backend/src/bundles/auth/auth.controller.ts +++ b/backend/src/bundles/auth/auth.controller.ts @@ -55,9 +55,9 @@ class AuthController extends BaseController { /** * @swagger - * /auth/sign-up: + * /auth/sign-in: * post: - * description: Sign up user into the application + * description: Sign in user into the application * requestBody: * description: User auth data * required: true @@ -72,7 +72,7 @@ class AuthController extends BaseController { * password: * type: string * responses: - * 201: + * 200: * description: Successful operation * content: * application/json: @@ -82,7 +82,15 @@ class AuthController extends BaseController { * message: * type: object * $ref: '#/components/schemas/User' + * 400: + * description: Failed operation + * content: + * application/json: + * schema: + * type: object + * $ref: '#/components/schemas/Error' */ + private async signIn( options: ApiHandlerOptions<{ body: UserSignInRequestDto; @@ -94,6 +102,37 @@ class AuthController extends BaseController { }; } + /** + * @swagger + * /auth/sign-up: + * post: + * description: Sign up user into the application + * requestBody: + * description: User auth data + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * email: + * type: string + * format: email + * password: + * type: string + * responses: + * 201: + * description: Successful operation + * content: + * application/json: + * schema: + * type: object + * properties: + * message: + * type: object + * $ref: '#/components/schemas/User' + */ + private async signUp( options: ApiHandlerOptions<{ body: UserSignUpRequestDto; diff --git a/backend/src/common/server-application/base-server-app-api.ts b/backend/src/common/server-application/base-server-app-api.ts index 6630eaebc..e86461e11 100644 --- a/backend/src/common/server-application/base-server-app-api.ts +++ b/backend/src/common/server-application/base-server-app-api.ts @@ -38,11 +38,27 @@ class BaseServerAppApi implements ServerAppApi { definition: { openapi: '3.0.0', info: { - title: 'Hello World', + title: 'OutreachVids API documentation', version: `${this.version}.0.0`, }, + components: { + schemas: { + Error: { + type: 'object', + properties: { + errorType: { + type: 'string', + enum: ['COMMON', 'VALIDATION'], + }, + message: { + type: 'string', + }, + }, + }, + }, + }, }, - apis: [`src/packages/**/*.controller.${controllerExtension}`], + apis: [`src/bundles/**/*.controller.${controllerExtension}`], }); } }