refactor(api): ♻️ Move from @hono/zod-openapi to hono-openapi

hono-openapi is easier to work with and generates better OpenAPI definitions
This commit is contained in:
Jesse Wierzbinski 2025-03-29 03:30:06 +01:00
parent 0576aff972
commit 58342e86e1
No known key found for this signature in database
240 changed files with 9494 additions and 9575 deletions

View file

@ -1,13 +1,21 @@
import { z } from "@hono/zod-openapi";
import ISO6391 from "iso-639-1";
import { z } from "zod";
export const Id = z.string().uuid();
export const iso631 = z
.enum(ISO6391.getAllCodes() as [string, ...string[]])
.openapi("ISO631");
.openapi({
description: "ISO 639-1 language code",
example: "en",
externalDocs: {
url: "https://en.wikipedia.org/wiki/List_of_ISO_639-1_language_codes",
},
ref: "ISO631",
});
export const zBoolean = z
.string()
.transform((v) => ["true", "1", "on"].includes(v.toLowerCase()))
.openapi({ type: "boolean" })
.or(z.boolean());