Skip to content

Commit 259831a

Browse files
MQ37MichalKalita
andauthored
Update src/utils/schema-generation.ts
Co-authored-by: Michal Kalita <[email protected]>
1 parent 3186c88 commit 259831a

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/utils/schema-generation.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,15 @@ export function generateSchemaFromItems(
9595
arrays: { mode: arrayMode },
9696
}) as JsonSchemaArray;
9797
return schema;
98-
} catch {
99-
// Fallback: try with simpler approach
100-
try {
101-
const fallbackSchema = toJsonSchema(processedItems, {
102-
arrays: { mode: 'first' },
103-
}) as JsonSchemaArray;
104-
return fallbackSchema;
105-
} catch {
106-
// If all attempts fail, return null
107-
return null;
108-
}
109-
}
98+
} catch { /* ignore */ }
99+
100+
try {
101+
const fallbackSchema = toJsonSchema(processedItems, {
102+
arrays: { mode: 'first' },
103+
}) as JsonSchemaArray;
104+
return fallbackSchema;
105+
} catch { /* ignore */ }
106+
107+
// If all attempts fail, return null
108+
return null;
110109
}

0 commit comments

Comments
 (0)