Skip to content

test(codegen): lock @deprecated JSDoc generation on deprecated JSON Schema properties#1918

Draft
bokelley wants to merge 1 commit into
mainfrom
claude/issue-1915-lock-deprecated-jsdoc-codegen
Draft

test(codegen): lock @deprecated JSDoc generation on deprecated JSON Schema properties#1918
bokelley wants to merge 1 commit into
mainfrom
claude/issue-1915-lock-deprecated-jsdoc-codegen

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Closes #1915

Summary

Extends test/jsdoc-constraints-codegen.test.js with a new describe block that locks the contract between deprecated: true in JSON Schema and @deprecated JSDoc in generated TypeScript. Filed in response to the expert review on adcontextprotocol/adcp#4904, which flagged that deprecated: true propagation through json-schema-to-typescript is partially reliable across toolchain versions.

Three regression tests added:

  • emits @deprecated JSDoc on a property with deprecated: true — mirrors the AdCP 3.1 additive-deprecate pattern (CreateMediaBuySuccess.status / UpdateMediaBuySuccess.status), asserts both the tag and the deprecation description text survive
  • does not emit @deprecated on a sibling property without deprecated: true — confirms the tag is property-scoped, not type-level
  • preserves description text alongside @deprecated when both are present — also asserts @minimum from injectJsdocConstraints survives alongside @deprecated (the coexistence case)

All tests use synthetic fixture schemas via runCodegenPipeline() — hermetic, no dependency on schemas/cache/latest/ or dist/.

No changeset needed (test-only change per CLAUDE.md).

What was tested

  • NODE_ENV=test node --test test/jsdoc-constraints-codegen.test.js10 pass, 6 skip (dist not built — expected), 0 fail
  • All 3 new tests in the @deprecated JSDoc — codegen regression lock suite pass
  • All 7 existing tests in injectJsdocConstraints — synthetic end-to-end continue to pass

Pre-PR review

  • code-reviewer: approved — no blockers; 2 nits (global /@deprecated/ regex is safe given jsts property-scoping; test 2 uses a separate schema compile rather than asserting doesNotMatch on the sibling within test 1's schema — correct isolation)
  • ad-tech-protocol-expert: approved — non-breaking per spec; asserting on ts output (not zod) is the correct lock; nit that adcp#4904 reference in the comment could become stale if that PR is retracted (not a behavior concern)

Nits noted (not fixed): both nits are style-level. The /@deprecated/ global scan is safe because jsts v15 places the tag only on the property JSDoc block, confirmed in generator.js:269. The adcp#4904 citation is also cited in the issue body and in the existing core.generated.ts deprecation context; stale risk is low.

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_018C9sUVC7R2zmTneFAH8PEp


Generated by Claude Code

…chema properties

Closes #1915

Adds three regression tests to `test/jsdoc-constraints-codegen.test.js` that
lock the behavior that `deprecated: true` in a JSON Schema property produces
`@deprecated` JSDoc in the TypeScript types generated by
`json-schema-to-typescript` v15.

Motivation: the expert review on adcontextprotocol/adcp#4904 (the 3.1
additive-deprecate on `CreateMediaBuySuccess.status` /
`UpdateMediaBuySuccess.status`) flagged that `deprecated: true` propagation
through codegen is partially reliable across toolchain versions. This test
fires on any jsts upgrade that silently drops the annotation, which would
remove the IDE deprecation signal for buyers without any runtime failure."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(codegen): lock @deprecated JSDoc generation on deprecated JSON Schema properties

1 participant