Skip to content

Commit 01cfac1

Browse files
authored
fix: disable ref strategy of JsonSchema (#3403)
1 parent f689cf0 commit 01cfac1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/utils/zod.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ export function getUnderlyingTypeName(zodType: ZodType): string {
5050
}
5151

5252
export function zodToStandardSchema(schema: zod.ZodSchema, name: string): Draft07 {
53-
const jsonSchema = zodToJsonSchema(schema, name) as Draft07
53+
const jsonSchema = zodToJsonSchema(schema, { name, $refStrategy: 'none' }) as Draft07
5454
const jsonSchemaWithEditorMeta = zodToJsonSchema(
5555
schema,
5656
{
5757
name,
58+
$refStrategy: 'none',
5859
override: (def) => {
5960
if (def.editor) {
6061
return {

0 commit comments

Comments
 (0)