Skip to content

docs(downgrader): note Hey API drops a bare object anyOf branch beside readOnly - #367

Merged
dinwwwh merged 12 commits into
mainfrom
claude/project-thread-ttohne
Nov 2, 2026
Merged

dinwwwh merged 12 commits into
mainfrom
claude/project-thread-ttohne

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Nov 2, 2026

Copy link
Copy Markdown
Member

Requested by dinwwwh · project thread

Summary

Docs only: this adds one sentence to the Hey API bullet in the downgrader README.

Hey API 0.99 drops a { type: "object" } branch that has nothing else in it from an anyOf, but only when the schema holds a readOnly or writeOnly property somewhere, even a nested one. The drop shows up in its types, in Zod and in Valibot. A 3.1 type: ["object", "string"] becomes that anyOf in 3.0, so Hey's 3.0 Zod and Valibot schemas reject an object there, while the 3.1 input accepts it.

Evidence

  • Real docs: I ran the Hey Zod runtime oracle on 83 OpenAPI 3.1/3.2 docs from npm packages published since Nov 1. It flagged 6 values, all in the Celigo/Boomi api-specs set (for example HTTP.encrypted and MCP.http.encrypted), with "expected string, received object".
  • Minimal case: the trigger is a readOnly or writeOnly sibling, at any depth, next to { anyOf: [{ type: object }, { type: string }] }. Without such a sibling, Hey keeps the union.
  • Not caused by 3.0: Hey drops the branch in the same way when a 3.1 doc writes that anyOf itself.
  • Avoiding it: adding additionalProperties: true to the branch keeps the union. Because this is Hey's own pruning, the change is a README note, not a code change.

Generated by Claude Code

claude added 12 commits November 2, 2026 08:51
3.1 has no default for a missing or unmapped discriminating value, so tools
following the kept discriminator (Hey API types and Zod) pin the default
schema's tag to its name and reject values 3.2 routes to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7PbWyR4kZ18CjgHzqs
… none of

3.1 lets a Discriminator Object carry specification extensions, 3.0 does
not, so an `x-` key there made the 3.0 output invalid. Microsoft.OpenApi's
3.0 reader reports it as an error, for example on the
`x-discriminator-default` that SwaggerHub's NPP and APDS specs write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7PbWyR4kZ18CjgHzqs
…m tag with a default required

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7PbWyR4kZ18CjgHzqs
…he tag default

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7PbWyR4kZ18CjgHzqs
…lue enum tag

Hey API pins each discriminator branch to its tag when the tag is a
one-value enum, as a const becomes, so its runtime plugins reject a
value that leaves out a tag with a default (Pydantic's Literal default).
From 3.1's const it uses the branch as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7PbWyR4kZ18CjgHzqs
…r 3.0 rules

Python's openapi-schema-validator and jsonschema-rs with draft 4 rules
reject a number with a zero fraction for type integer, as 3.0.3 defined
an integer; 3.0.4, which the output names, accepts it as 3.1 does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7PbWyR4kZ18CjgHzqs
…e readOnly

Hey API 0.99 drops a `{ type: "object" }` branch with nothing else in it from an
`anyOf` in a schema that holds a readOnly or writeOnly property, so its types,
Zod and Valibot reject an object for a `type` list with "object" in 3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7PbWyR4kZ18CjgHzqs
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing claude/project-thread-ttohne (2a72f89) with main (d60844d)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Docs-only change adding one sentence to the Hey API limitation bullet in packages/downgrader/README.md.

  • Hey API bare-object anyOf branch drop — notes that Hey API drops a { type: "object" } anyOf branch with nothing else in it, which a downgraded 3.1 type: ["object", …] becomes, when the schema holds a readOnly/writeOnly property, so Hey's types, Zod and Valibot then reject an object (Celigo encrypted fields).

The sentence reads consistently with the surrounding bullet (same also cadence, such as examples, "its types and those plugins" referring to the Zod/Valibot plugins named earlier), is scoped to the downgraded 3.0 output that the type-list → anyOf conversion produces (v3.1-to-v3.0.ts:845-869), and does not contradict the bullet's closing "Hey API reads 3.1 too…" claim. uncheck (oxfmt) passes on the file.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@dinwwwh
dinwwwh merged commit d1d2512 into main Nov 2, 2026
9 checks passed
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.

2 participants