From edd032651dcb591eea97a3dc8d5c201373049d63 Mon Sep 17 00:00:00 2001 From: Nourman Hajar Date: Fri, 29 Sep 2023 20:13:42 +0700 Subject: [PATCH] refactor: rename variable --- packages/zod-openapi/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/zod-openapi/src/index.ts b/packages/zod-openapi/src/index.ts index 1c8a44f49..feceac086 100644 --- a/packages/zod-openapi/src/index.ts +++ b/packages/zod-openapi/src/index.ts @@ -189,15 +189,15 @@ export class OpenAPIHono< > extends Hono { openAPIRegistry: OpenAPIRegistry defaultHook?: OpenAPIHonoOptions['defaultHook'] - strictResponseCode?: OpenAPIHonoOptions['strictStatusCode'] - strictResponseSchema?: OpenAPIHonoOptions['strictResponse'] + strictStatusCode?: OpenAPIHonoOptions['strictStatusCode'] + strictResponse?: OpenAPIHonoOptions['strictResponse'] constructor(init?: HonoInit) { super(init) this.openAPIRegistry = new OpenAPIRegistry() this.defaultHook = init?.defaultHook - this.strictResponseCode = init?.strictStatusCode - this.strictResponseSchema = init?.strictResponse + this.strictStatusCode = init?.strictStatusCode + this.strictResponse = init?.strictResponse } openapi = < @@ -262,7 +262,7 @@ export class OpenAPIHono< } } - if (this.strictResponseSchema) { + if (this.strictResponse) { const responseZodSchemaObject: Record> = {} for (const [statusCode, responseConfig] of Object.entries(route.responses)) { for (const mediaTypeObject of Object.values(responseConfig.content ?? {})) { @@ -292,7 +292,7 @@ export class OpenAPIHono< } } - if (this.strictResponseCode) { + if (this.strictStatusCode) { validators.push(async (c, next) => { await next()