Skip to content

Commit 5a85885

Browse files
committed
Add ez.buffer to the list of JSON incompatible ones.
1 parent a634d84 commit 5a85885

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

express-zod-api/src/deep-checks.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { $ZodType, JSONSchema } from "zod/v4/core";
22
import * as R from "ramda";
33
import { z } from "zod/v4";
4+
import { ezBufferBrand } from "./buffer-schema";
45
import { ezDateInBrand } from "./date-in-schema";
56
import { ezDateOutBrand } from "./date-out-schema";
67
import { DeepCheckError } from "./errors";
@@ -91,6 +92,7 @@ export const findJsonIncompatible = (
9192
const brand = getBrand(zodSchema);
9293
const { type } = zodSchema._zod.def;
9394
if (unsupported.includes(type)) return true;
95+
if (brand === ezBufferBrand) return true;
9496
if (io === "input") {
9597
if (type === "date") return true;
9698
if (brand === ezDateOutBrand) return true;

express-zod-api/tests/routing.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ describe("Routing", () => {
522522
[z.lazy(() => z.void()), ez.raw()],
523523
[z.promise(z.any()), ez.upload()],
524524
[z.never(), z.tuple([ez.buffer()]).rest(z.nan())],
525-
[z.nan().pipe(z.any()), circular],
525+
[ez.buffer().pipe(z.any()), circular],
526526
])("should warn about JSON incompatible schemas %#", (input, output) => {
527527
const endpoint = new EndpointsFactory(defaultResultHandler).build({
528528
input: z.object({ input }),

0 commit comments

Comments
 (0)