Conversation
…I importers Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
…om changelog Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…avy fixture Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…x diff comment Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
SDK Generation Benchmark ResultsComparing PR branch against latest nightly baseline on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Docs Generation Benchmark ResultsComparing PR branch against latest nightly baseline on
Docs generation runs |
Description
Fix "Expected list. Received null." error when importing OpenAPI specs with null security scopes. Some real-world specs use
{oauth2: null}instead of{oauth2: []}in security requirement objects, which causes all generators to crash during IR serialization.Root cause: PR #9546 (Sept 2025) added the
securityfield to the IR but the importers passoperation.securitystraight through without sanitizing null scope values. The Zurglist(AuthScope)validator rejectsnullat generation time.Real-world evidence:
security: [{oauth2: null}]on endpoints that don't require specific scopes — this crashes all generators on mainvalue ?? []) in March 2025Changes Made
sanitizeSecurityScopes()utility with concreteRecord<string, string[]>return type (no unnecessary generics/casts):@fern-api/v3-importer-commonsfor the 3.1 importer (OperationConverter.ts)utils/sanitizeSecurityScopes.tsinopenapi-ir-parserfor v3 importers (convertHttpOperation.ts,generateIr.ts) — separate copy required due to circular dependency constraint (openapi-ir-parser→v3-importer-commons→api-workspace-commons→openapi-ir-parser). The copy includes a cross-reference comment pointing to the canonical version and its tests.as Record<string, string[]>[]cast is documented as safe since OpenAPI scopes are alwaysstring[] | nullv3-importer-commonsalongside the canonical utilityfix-null-security-scopes.ymlunreleased changelog entryTesting
sanitizeSecurityScopescovering: undefined/null input, valid scopes passthrough, null→[] sanitization, mixed null/valid scopes, multiple requirements, empty arrays{oauth2: null}on endpointsLink to Devin session: https://app.devin.ai/sessions/f3bb4b99c28047a982ec031297681298