Skip to content

Commit 3482164

Browse files
authored
feat: add @deprecated comment on schema objects (#747)
Co-authored-by: dcarlson <Daversion216>
1 parent a01f57a commit 3482164

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/transform/schema.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export function transformSchemaObjMap(obj: Record<string, any>, options: Transfo
1919
const v = obj[k];
2020

2121
// 1. JSDoc comment (goes above property)
22-
if (v.description) output += comment(v.description);
22+
let schemaComment = "";
23+
if (v.deprecated) schemaComment += `@deprecated `;
24+
if (v.description) schemaComment += v.description;
25+
if (schemaComment) output += comment(schemaComment);
2326

2427
// 2. name (with “?” if optional property)
2528
const readonly = tsReadonly(options.immutableTypes);

0 commit comments

Comments
 (0)