From eefe1c63383d2e00cb8e4a71dd578d7d2c0603b1 Mon Sep 17 00:00:00 2001 From: 13XAVI Date: Tue, 25 Jun 2024 09:10:45 -0500 Subject: [PATCH] inserted documentation --- src/docs/subscribe.ts | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/docs/subscribe.ts diff --git a/src/docs/subscribe.ts b/src/docs/subscribe.ts new file mode 100644 index 0000000..511af5a --- /dev/null +++ b/src/docs/subscribe.ts @@ -0,0 +1,87 @@ +/** + * @swagger + * tags: + * name: Subscribe + * description: Subscription management + */ + +/** + * @openapi + * /api/v1/subscribe: + * post: + * tags: [Subscribe] + * summary: Subscribe user to our app + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * email: + * type: string + * example: test@gmail.com + * responses: + * 201: + * description: Subscribed successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * message: + * type: string + * example: Subscribed successfully + * subscription: + * type: object + * properties: + * email: + * type: string + * example: test@gmail.com + */ + +/** + * @openapi + * /api/v1/subscribe/delete/{id}: + * delete: + * tags: [Subscribe] + * summary: Removes a user from subscription + * parameters: + * - in: path + * name: id + * required: true + * schema: + * type: integer + * example: 1 + * responses: + * 200: + * description: Subscription removed successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * message: + * type: string + * example: Subscription removed successfully + * 404: + * description: Subscription not found + * content: + * application/json: + * schema: + * type: object + * properties: + * message: + * type: string + * example: Subscription not found + * 400: + * description: Invalid ID + * content: + * application/json: + * schema: + * type: object + * properties: + * message: + * type: string + * example: Invalid ID + */