From acdfc7eda49d4d440507bf52ad3c3229d4c6fdbd Mon Sep 17 00:00:00 2001 From: Rushil Perera Date: Sun, 16 Jun 2024 08:48:20 -0400 Subject: [PATCH] docs: add error status codes for /token --- src/controllers/token/index.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/controllers/token/index.ts b/src/controllers/token/index.ts index b8c6148..dc43684 100644 --- a/src/controllers/token/index.ts +++ b/src/controllers/token/index.ts @@ -11,6 +11,7 @@ import { saveToken } from "~/models/token"; import type { Env } from "~/types/env"; import { ErrorResponse, + ErrorResponseSchema, SuccessResponse, SuccessResponseSchema, } from "~/types/schema"; @@ -49,6 +50,22 @@ const route = createRoute({ }, description: "Saved token successfully", }, + 412: { + content: { + "application/json": { + schema: ErrorResponseSchema, + }, + }, + description: "Token already exists", + }, + 500: { + content: { + "application/json": { + schema: ErrorResponseSchema, + }, + }, + description: "Unknown error occurred", + }, }, });