import { z } from "@hono/zod-openapi";const title = z.string().openapi({ description: 'Job title', example: 'My job', ref: 'jobTitle',});
import { z } from "@hono/zod-openapi";const title = z.string().openapi({ description: 'Job title', example: 'My job', ref: 'jobTitle',});
Then I get:
src/schema/plfpl-schema.ts(28,26): error TS2769: No overload matches this call. Overload 1 of 2, '(this: ZodString, metadata: Partial<ZodOpenAPIMetadata<string, string>>): ZodString', gave the following error. Object literal may only specify known properties, and 'ref' does not exist in type 'Partial<ZodOpenAPIMetadata<string, string>>'. Overload 2 of 2, '(this: ZodString, refId: string, metadata?: Partial<ZodOpenAPIMetadata<string, string>> | undefined): ZodString', gave the following error. Argument of type '{ description: string; example: string; ref: string; }' is not assignable to parameter of type 'string'.
src/schema/plfpl-schema.ts(28,26): error TS2769: No overload matches this call. Overload 1 of 2, '(this: ZodString, metadata: Partial<ZodOpenAPIMetadata<string, string>>): ZodString', gave the following error. Object literal may only specify known properties, and 'ref' does not exist in type 'Partial<ZodOpenAPIMetadata<string, string>>'. Overload 2 of 2, '(this: ZodString, refId: string, metadata?: Partial<ZodOpenAPIMetadata<string, string>> | undefined): ZodString', gave the following error. Argument of type '{ description: string; example: string; ref: string; }' is not assignable to parameter of type 'string'.
Am I missing something? How should I construct references?