Repository navigation
docs(downgrader): note that a 3.1 document using 3.2 itemSchema needs downgradeSpecV32ToV31 first - #211
Conversation
… downgradeSpecV32ToV31 first FastAPI writes `openapi: 3.1.0` but uses the 3.2 Media Type `itemSchema` for streaming responses. downgradeSpecV31ToV30 keeps it as written, so running downgradeSpecV32ToV31 first is the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VVaw7Rkz42kTVSQGsy5dqn
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
- Downgrader 3.1→3.0 limitation note — adds one bullet to
packages/downgrader/README.md's### Spec (downgradeSpecV31ToV30)→#### Limitationsdocumenting that a 3.1 document already carrying 3.2 fields (FastAPI's streamingitemSchema) keeps them as written, with the schemas inside left unconverted, and pointing to runningdowngradeSpecV32ToV31first.
I verified the claim against the code rather than taking it on faith: v3.1→3.0 MEDIA_TYPE_FIELDS lists only encoding/examples/schema, so itemSchema is deep-cloned through convertObject untouched and its inner schemas never reach convertSchema; and v3.2→3.1 defines itemSchema: DROP plus finishMediaType rewriting it to schema: { type: 'array', items: convertSchema(itemSchema) }. I also confirmed the FastAPI example against current fastapi/fastapi: openapi_version defaults to "3.1.0" while JSONL/SSE streaming routes emit itemSchema (SSE additionally carrying contentSchema/contentMediaType inside it). Placement in the 3.1→3.0 spec limitations is correct, and uncheck packages/downgrader/README.md passes (oxlint + oxfmt).
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Requested by dinwwwh · project thread
What
Adds one line to the 3.1 → 3.0 Spec Limitations in
packages/downgrader/README.md:Why
FastAPI 0.162.0 writes
openapi: 3.1.0but uses the 3.2 Media TypeitemSchemafor JSONL and SSE routes.downgradeSpecV31ToV30keepsitemSchema(and the 3.1 keywords inside it, such ascontentSchemaandtypelists) as written, so the 3.0 output is invalid. RunningdowngradeSpecV32ToV31first turns eachitemSchemaintoschema: { type: "array", items: … }, and the result downgrades cleanly.Probe on main, with a FastAPI-shaped SSE route and a JSONL route:
contentdowngradeSpecV31ToV30onlyitemSchemakept,contentMediaType/contentSchemaandtype: ["string", "null"]kept inside itdowngradeSpecV32ToV31thendowngradeSpecV31ToV30schema: { type: "array", items: … }, withdataas{ type: "string" }oRPC builds 3.2 and runs both steps, so its output never has this shape; a README note is the simple fit.
Generated by Claude Code