UNPKG

chanfana

Version:

OpenAPI 3 and 3.1 schema generator and validator for Hono, itty-router and more!

18 lines (15 loc) 290 B
import type { z } from "zod"; type JsonContent<T> = { content: { "application/json": { schema: z.ZodType<T>; }; }; }; export const contentJson = <T>(schema: z.ZodType<T>): JsonContent<T> => ({ content: { "application/json": { schema: schema, }, }, });