fix: OpenAPI spec not generating properly

Summary:

Test Plan:
This commit is contained in:
2024-05-24 14:56:34 -04:00
parent 88b1a4ced5
commit 62e780e8bf
4 changed files with 28 additions and 19 deletions

View File

@@ -17,7 +17,10 @@ const route = createRoute({
method: "get",
path: "/",
request: {
query: z.object({ query: z.string(), page: z.number().min(1).default(1) }),
query: z.object({
query: z.string(),
page: z.number({ coerce: true }).int().min(1).default(1),
}),
},
responses: {
200: {

View File

@@ -2,7 +2,7 @@ import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
import { fetchFromMultipleSources } from "~/libs/fetchFromMultipleSources";
import {
AniListIdSchema,
AniListIdQuerySchema,
ErrorResponseSchema,
SuccessResponseSchema,
} from "~/types/schema";
@@ -20,7 +20,7 @@ const route = createRoute({
method: "get",
path: "/",
request: {
query: z.object({ id: AniListIdSchema }),
query: z.object({ id: AniListIdQuerySchema }),
headers: z.object({ "x-anilist-token": z.string().nullish() }),
},
responses: {