Skip to content

fix(compilers/openapi): report a bare deprecation extension key - #463

Open
fuad-daoud wants to merge 1 commit into
mainfrom
fix/bare-extension-key-declines
Open

fix(compilers/openapi): report a bare deprecation extension key#463
fuad-daoud wants to merge 1 commit into
mainfrom
fix/bare-extension-key-declines

Conversation

@fuad-daoud

Copy link
Copy Markdown
Collaborator

Summary

extensionText decoded a preserved extension value into a plain string, and JSON null decodes into one without error, leaving it empty. So a bare key — x-sunset: with no value, the natural presence-only spelling in YAML — read as text that says nothing: an empty Deprecation field written, the node marked extension-promotion, and no diagnostic, while the comment beside the decode says a value of another JSON shape "is a document meaning something else by the key".

Decode into *string so a key with no value is told apart from an empty string a document actually wrote, and report it the way the other shapes are (openapi/degraded-construct, info). Found in review of #439, where extensionOpenness had the same null-into-a-value-type decode; that one is fixed on the stack, and this is the same mechanism on main, swept as its own change.

Test plan

  • TestPromoteDeprecation_ValueThatIsNotTextIsReported is a table now, with a null row beside the number; reverting the decode reddens exactly that row.
  • make gate green from a clean worktree.

🤖 Generated with Claude Code

https://claude.ai/code/session_011T5no6iADeMGgYjsYcV5in

JSON null decodes into a plain string without error and leaves it empty, so
a bare `x-sunset:` read as text that says nothing: an empty field written,
the node marked inferred, and no diagnostic — while the doc beside it says a
value of another shape is a document meaning something else by the key.
Decode into *string so a key with no value is told apart from an empty
string a document wrote, and report it as the other shapes are.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T5no6iADeMGgYjsYcV5in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant