From d91294ee494ad9e2c2b4df67109fb3d72fb574c5 Mon Sep 17 00:00:00 2001 From: T0nd0Tara <5632815@gmail.com> Date: Wed, 6 Aug 2025 14:44:20 +0300 Subject: [PATCH] allow numbers as status codes in responses --- src/openapi-registry.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openapi-registry.ts b/src/openapi-registry.ts index 21fac93..c07550b 100644 --- a/src/openapi-registry.ts +++ b/src/openapi-registry.ts @@ -107,6 +107,8 @@ type ZodObjectWithEffect = ZodObject | ZodPipe; export type RouteParameter = ZodObjectWithEffect | undefined; +export type StatusCode = string | number; + export type RouteConfig = Omit & { method: Method; path: string; @@ -118,7 +120,7 @@ export type RouteConfig = Omit & { headers?: RouteParameter | ZodType[]; }; responses: { - [statusCode: string]: ResponseConfig | ReferenceObject; + [statusCode: StatusCode]: ResponseConfig | ReferenceObject; }; };