Skip to content

Commit 6c96924

Browse files
committed
bugfix: always generate standalone types for refs
1 parent 31993de commit 6c96924

File tree

3 files changed

+56319
-83385
lines changed

3 files changed

+56319
-83385
lines changed

src/normalizer.ts

-9
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,12 @@ rules.set('Add an $id to anything that needs it', (schema, fileName, _options, _
8484
return
8585
}
8686

87-
// Sub-schemas with references
88-
if (!isArrayType(schema) && !isObjectType(schema)) {
89-
return
90-
}
91-
9287
// We'll infer from $id and title downstream
9388
// TODO: Normalize upstream
9489
const dereferencedName = dereferencedPaths.get(schema)
9590
if (!schema.$id && !schema.title && dereferencedName) {
9691
schema.$id = toSafeString(justName(dereferencedName))
9792
}
98-
99-
if (dereferencedName) {
100-
dereferencedPaths.delete(schema)
101-
}
10293
})
10394

10495
rules.set('Escape closing JSDoc comment', schema => {

test/__snapshots__/test/test.ts.md

+56,319-83,376
Large diffs are not rendered by default.

test/__snapshots__/test/test.ts.snap

-73.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)