test(codegen): lock @deprecated JSDoc generation on deprecated JSON Schema properties#1918
Draft
bokelley wants to merge 1 commit into
Draft
test(codegen): lock @deprecated JSDoc generation on deprecated JSON Schema properties#1918bokelley wants to merge 1 commit into
bokelley wants to merge 1 commit into
Conversation
…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."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1915
Summary
Extends
test/jsdoc-constraints-codegen.test.jswith a newdescribeblock that locks the contract betweendeprecated: truein JSON Schema and@deprecatedJSDoc in generated TypeScript. Filed in response to the expert review on adcontextprotocol/adcp#4904, which flagged thatdeprecated: truepropagation throughjson-schema-to-typescriptis partially reliable across toolchain versions.Three regression tests added:
@deprecatedJSDoc on a property withdeprecated: true— mirrors the AdCP 3.1 additive-deprecate pattern (CreateMediaBuySuccess.status/UpdateMediaBuySuccess.status), asserts both the tag and the deprecation description text survive@deprecatedon a sibling property withoutdeprecated: true— confirms the tag is property-scoped, not type-level@deprecatedwhen both are present — also asserts@minimumfrominjectJsdocConstraintssurvives alongside@deprecated(the coexistence case)All tests use synthetic fixture schemas via
runCodegenPipeline()— hermetic, no dependency onschemas/cache/latest/ordist/.No changeset needed (test-only change per CLAUDE.md).
What was tested
NODE_ENV=test node --test test/jsdoc-constraints-codegen.test.js— 10 pass, 6 skip (dist not built — expected), 0 fail@deprecated JSDoc — codegen regression locksuite passinjectJsdocConstraints — synthetic end-to-endcontinue to passPre-PR review
/@deprecated/regex is safe given jsts property-scoping; test 2 uses a separate schema compile rather than assertingdoesNotMatchon the sibling within test 1's schema — correct isolation)tsoutput (notzod) is the correct lock; nit thatadcp#4904reference 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 ingenerator.js:269. Theadcp#4904citation is also cited in the issue body and in the existingcore.generated.tsdeprecation context; stale risk is low.Session: https://claude.ai/code/session_018C9sUVC7R2zmTneFAH8PEp
Generated by Claude Code