aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-01 21:11:12 +0900
committernsfisis <nsfisis@gmail.com>2024-08-01 21:11:12 +0900
commitd4b76effa883fc191b82027e7d76d1f34fcc2992 (patch)
tree7cf594ef1cac367f1ffba384a8508ade8e39bd0e /frontend
parentebb1129ae9ef16139a32bf899d42009176642299 (diff)
downloadiosdc-japan-2024-albatross-d4b76effa883fc191b82027e7d76d1f34fcc2992.tar.gz
iosdc-japan-2024-albatross-d4b76effa883fc191b82027e7d76d1f34fcc2992.tar.zst
iosdc-japan-2024-albatross-d4b76effa883fc191b82027e7d76d1f34fcc2992.zip
refactor: simplify error responses in OpenAPI spec
Diffstat (limited to 'frontend')
-rw-r--r--frontend/app/.server/api/schema.d.ts277
1 files changed, 60 insertions, 217 deletions
diff --git a/frontend/app/.server/api/schema.d.ts b/frontend/app/.server/api/schema.d.ts
index 37e9b8c..6198064 100644
--- a/frontend/app/.server/api/schema.d.ts
+++ b/frontend/app/.server/api/schema.d.ts
@@ -128,6 +128,10 @@ export interface paths {
export type webhooks = Record<string, never>;
export interface components {
schemas: {
+ Error: {
+ /** @example Invalid request */
+ message: string;
+ };
User: {
/** @example 123 */
user_id: number;
@@ -258,7 +262,44 @@ export interface components {
stderr: string;
};
};
- responses: never;
+ responses: {
+ /** @description Bad request */
+ BadRequest: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description Unauthorized */
+ Unauthorized: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description Forbidden */
+ Forbidden: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description Not found */
+ NotFound: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
parameters: {
header_authorization: string;
path_game_id: number;
@@ -299,18 +340,7 @@ export interface operations {
};
};
};
- /** @description Invalid username or password */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Invalid credentials */
- message: string;
- };
- };
- };
+ 401: components["responses"]["Unauthorized"];
};
};
getToken: {
@@ -336,18 +366,7 @@ export interface operations {
};
};
};
- /** @description Unauthorized */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Unauthorized */
- message: string;
- };
- };
- };
+ 401: components["responses"]["Unauthorized"];
};
};
getGames: {
@@ -372,30 +391,8 @@ export interface operations {
};
};
};
- /** @description Unauthorized */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Unauthorized */
- message: string;
- };
- };
- };
- /** @description Forbidden */
- 403: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Forbidden operation */
- message: string;
- };
- };
- };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["Forbidden"];
};
};
getGame: {
@@ -422,42 +419,9 @@ export interface operations {
};
};
};
- /** @description Unauthorized */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Unauthorized */
- message: string;
- };
- };
- };
- /** @description Forbidden */
- 403: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Forbidden operation */
- message: string;
- };
- };
- };
- /** @description Not found */
- 404: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Not found */
- message: string;
- };
- };
- };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["Forbidden"];
+ 404: components["responses"]["NotFound"];
};
};
adminGetUsers: {
@@ -482,30 +446,8 @@ export interface operations {
};
};
};
- /** @description Unauthorized */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Unauthorized */
- message: string;
- };
- };
- };
- /** @description Forbidden */
- 403: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Forbidden operation */
- message: string;
- };
- };
- };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["Forbidden"];
};
};
adminGetGames: {
@@ -530,30 +472,8 @@ export interface operations {
};
};
};
- /** @description Unauthorized */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Unauthorized */
- message: string;
- };
- };
- };
- /** @description Forbidden */
- 403: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Forbidden operation */
- message: string;
- };
- };
- };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["Forbidden"];
};
};
adminGetGame: {
@@ -580,42 +500,9 @@ export interface operations {
};
};
};
- /** @description Unauthorized */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Unauthorized */
- message: string;
- };
- };
- };
- /** @description Forbidden */
- 403: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Forbidden operation */
- message: string;
- };
- };
- };
- /** @description Not found */
- 404: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Not found */
- message: string;
- };
- };
- };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["Forbidden"];
+ 404: components["responses"]["NotFound"];
};
};
adminPutGame: {
@@ -656,54 +543,10 @@ export interface operations {
};
content?: never;
};
- /** @description Invalid request */
- 400: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Invalid request */
- message: string;
- };
- };
- };
- /** @description Unauthorized */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Unauthorized */
- message: string;
- };
- };
- };
- /** @description Forbidden */
- 403: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Forbidden operation */
- message: string;
- };
- };
- };
- /** @description Not found */
- 404: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": {
- /** @example Not found */
- message: string;
- };
- };
- };
+ 400: components["responses"]["BadRequest"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["Forbidden"];
+ 404: components["responses"]["NotFound"];
};
};
}