From 19e47ff975dab4f953e636a5074d35f328000045 Mon Sep 17 00:00:00 2001 From: Rushi Gandhi Date: Fri, 18 Oct 2024 10:21:57 +0530 Subject: [PATCH] documented the new endpoint in the openapi.json --- Server/openapi.json | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/Server/openapi.json b/Server/openapi.json index 6d079e685..6dc9ef360 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -229,6 +229,75 @@ } } }, + "/auth/refresh": { + "post": { + "tags": ["auth"], + "description": "Generates a new auth token if the refresh token is valid.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + }, + "required": false + }, + "parameters": [ + { + "name": "x-refresh-token", + "in": "header", + "description": "Refresh token required to generate a new auth token.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "authorization", + "in": "header", + "description": "Old access token, used to extract payload).", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "New access token generated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } + } + }, + "401": { + "description": "Unauthorized or invalid refresh token.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, "/auth/user/{userId}": { "put": { "tags": ["auth"],