Skip to content

Commit 721bc8c

Browse files
committed
Remove x-brand override from vitest schemaSerializer (moved to plugin).
1 parent 0e2de73 commit 721bc8c

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

express-zod-api/vitest.setup.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { getBrand } from "@express-zod-api/zod-plugin";
21
import type { NewPlugin } from "@vitest/pretty-format";
32
import { z } from "zod";
43
import { ResultHandlerError } from "./src/errors";
@@ -23,13 +22,7 @@ const errorSerializer: NewPlugin = {
2322
const schemaSerializer: NewPlugin = {
2423
test: (subject) => subject instanceof z.ZodType,
2524
serialize: (entity: z.ZodType, config, indentation, depth, refs, printer) => {
26-
const serialization = z.toJSONSchema(entity, {
27-
unrepresentable: "any",
28-
override: ({ zodSchema, jsonSchema }) => {
29-
if (zodSchema._zod.def.type === "custom")
30-
jsonSchema["x-brand"] = getBrand(zodSchema);
31-
},
32-
});
25+
const serialization = z.toJSONSchema(entity, { unrepresentable: "any" });
3326
return printer(serialization, config, indentation, depth, refs);
3427
},
3528
};

0 commit comments

Comments
 (0)