Repository navigation
docs(downgrader): oapi-codegen stops on an inline nullable number enum - #392
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VVaw7RH2JEkf9zKoSXLUbC
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 21 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Documented an oapi-codegen limitation in
packages/downgrader/README.md: theoapi-codegen 2.8bullet now records that it stops on a numeric or boolean nullableenumin a parameter or an inline object property, and that 3.1's untypedenumis read fine.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Docs only. This adds a sentence to the oapi-codegen bullet in
packages/downgrader/README.md.Since #380, an
enumthat has null but notypegets typed as{ type: "integer", nullable: true, enum: [1, 2, null] }. Zod 4.6.7 writes exactly that forz.literal([1, 2, null]), and so does oRPC beta.49 (with downgrader 0.7.1). oapi-codegen v2.8.2 (-generate types,std-http-server) then stops with:{type: integer|number|boolean, nullable: true, enum: [.., null]}{type: string, nullable: true, enum: [.., null]}{enum: [1, 2, null]}(the input)type: ["integer", "null"], enum: [1, 2, null]The real oRPC beta.49 3.0.4 output of
gq.mjs(lit: z.literal([1, 2, null])as a GET query parameter) fails with the error above.I'm not proposing a code change. Going back to the untyped enum would bring back the kin-openapi
VisitJSON(nil)rejection that #380 fixed. The other shape, aoneOfwith the"null"branch last, would hit kin-openapi's request decoding of the last branch (#389) for a query?lit=1. The typed form passes both of those, and only oapi-codegen's inline enum generation trips on it.Generated by Claude Code