Repository navigation
docs(downgrader): note that a bare tagged $ref drops readOnly and similar annotations - #192
Conversation
…ilar annotations Since #174 (and #150 for branches), a `$ref` with only annotations beside it to a schema whose `discriminator` stays becomes the bare `$ref` in 3.0, so a `readOnly`, `writeOnly`, `default` or `deprecated` beside it is lost. The `$ref` with siblings row now says so, with the Cryptography Provider API's `readOnly` as the example. No code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VVaw7P8yYent5wfYg87EkH
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Bare-
$refannotation loss noted — appends to theA [$ref][js-ref] with siblingsrow ofpackages/downgrader/README.md: in both bare-$refrewrites (aoneOf/anyOfbranch beside a survivingdiscriminator, and a$refwith only annotations to a schema whosediscriminatorstays), the annotations beside the$refare dropped, so areadOnly,writeOnly,defaultordeprecatedthere is lost. Cites the Cryptography Provider API'sreadOnlyas the example.
The claim matches the code: convertTaggedBranch → convertSchemaRef and convertSchema's isAnnotatedRef + isTaggedRef path both emit a bare { $ref }, and ANNOTATION_KEYWORDS in v3.1-to-v3.0.ts contains default, deprecated, readOnly, and writeOnly. The behavior is pinned by the tests keeps a $ref beside only annotations bare in a union beside a discriminator and keeps a $ref beside only annotations bare to a schema with a discriminator (packages/downgrader/tests/v3.1-to-v3.0.test.ts:1885, :1936), and uncheck passes on the README.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Requested by dinwwwh · project thread
Docs only, no code change.
Since #174 (and #150 for branches beside a discriminator), a
$refwith only annotations beside it to a schema whosediscriminatorstays becomes the bare$refin 3.0. The annotations go with it, and that set includesreadOnly,writeOnly,defaultanddeprecated, so those are lost too:{ "$ref": "#/components/schemas/KeyDataV2", "description": "...", "readOnly": true }now becomes
{ "$ref": "#/components/schemas/KeyDataV2" }. In the Cryptography Provider v2 API that makes openapi-typescript dropreadonlyonExportKeyResponseV2Dto.keyData, and Kiota gives it a public setter.This is rare. Across a corpus of 19,775 real docs, #174 changes 1,553 sites, and only 3 of them carry one of these keywords (1
readOnly, 2deprecated). oRPC never writes adiscriminator, so its output never hits this path. A README note fits better than keeping theallOfwrapper at those few sites.The
$refwith siblings row now ends with: "In both cases the annotations beside the$refare dropped, so areadOnly,writeOnly,defaultordeprecatedthere is lost, as for thereadOnlythe Cryptography Provider API writes beside one."Generated by Claude Code