Skip to content

Commit 6e6414f

Browse files
committed
Refines JSON import typing from previous commit
1 parent 1a9cb1a commit 6e6414f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/examples.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { describe, it, expect } from "vitest";
22
import { convertJsonSchemaToZod } from "./index";
33
import { z } from "zod/v4";
44
import type { JSONSchema } from "zod/v4/core";
5-
import examples from "./examples.json";
5+
import jsonExampleData from "./examples.json" assert { type: "json"};
6+
const examples = jsonExampleData as JSONSchema.BaseSchema[];
7+
68

79
// Helper function to find differences between objects
810
function findDifferences(original: any, result: any, path = ""): string[] {
@@ -55,7 +57,7 @@ describe("examples tests", () => {
5557
it(`should correctly convert example ${index}`, () => {
5658
try {
5759
// Convert JSON schema to Zod
58-
const zodSchema = convertJsonSchemaToZod(example as unknown as JSONSchema.BaseSchema);
60+
const zodSchema = convertJsonSchemaToZod(example);
5961

6062
// Convert Zod schema back to JSON schema
6163
const resultSchema = z.toJSONSchema(zodSchema);

0 commit comments

Comments
 (0)