Skip to content

Commit e8fa879

Browse files
committed
fix: dont bail out when there's an undefined ref, continue the generation and mark it appropriately
1 parent db2295e commit e8fa879

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

lib/process-schema.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,18 @@ export function schemaToType(
3939
const existingSchema = typesAndInterfaces.get(schemaObject.$ref);
4040

4141
if (!existingSchema) {
42-
throw new Error(`ref used before available: ${schemaObject.$ref}`);
42+
// throw new Error(`ref used before available: ${schemaObject.$ref}`);
43+
console.warn(`ref used before available: ${schemaObject.$ref}`);
44+
return {
45+
name,
46+
hasQuestionToken,
47+
type: 'unknown',
48+
docs: [
49+
{
50+
description: `WARN: $ref used before available - ${schemaObject.$ref}`,
51+
},
52+
],
53+
};
4354
}
4455

4556
return {

0 commit comments

Comments
 (0)