Skip to content

Commit

Permalink
refactor: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
masnormen committed Sep 29, 2023
1 parent 1c0a665 commit edd0326
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/zod-openapi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ export class OpenAPIHono<
> extends Hono<E, S, BasePath> {
openAPIRegistry: OpenAPIRegistry
defaultHook?: OpenAPIHonoOptions<E>['defaultHook']
strictResponseCode?: OpenAPIHonoOptions<E>['strictStatusCode']
strictResponseSchema?: OpenAPIHonoOptions<E>['strictResponse']
strictStatusCode?: OpenAPIHonoOptions<E>['strictStatusCode']
strictResponse?: OpenAPIHonoOptions<E>['strictResponse']

constructor(init?: HonoInit<E>) {
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 = <
Expand Down Expand Up @@ -262,7 +262,7 @@ export class OpenAPIHono<
}
}

if (this.strictResponseSchema) {
if (this.strictResponse) {
const responseZodSchemaObject: Record<string, ZodType<any>> = {}
for (const [statusCode, responseConfig] of Object.entries(route.responses)) {
for (const mediaTypeObject of Object.values(responseConfig.content ?? {})) {
Expand Down Expand Up @@ -292,7 +292,7 @@ export class OpenAPIHono<
}
}

if (this.strictResponseCode) {
if (this.strictStatusCode) {
validators.push(async (c, next) => {
await next()

Expand Down

0 comments on commit edd0326

Please sign in to comment.