fix(openapi): extract success responses declared with wildcard 2XX status keys#1275
Conversation
…atus keys Microsoft Graph's OpenAPI spec declares every success response under the wildcard status key 2XX (13k+ occurrences, no numeric 200/201 keys at all), which the extractor's /^2\d\d$/ filter skipped entirely. No response body or file hint was ever extracted for Graph operations, so drive content downloads never took the binaryResponse ToolFile path and came back as lossy text. Accept 2XX between exact codes and default. Also normalize Microsoft Graph octet-stream success responses that carry a non-binary schema (report-style endpoints declare type: object there) to a binary string during spec build, and run full-graph selections through the same path-item transform. The Cloudflare extraction baseline gains one operation whose success response is declared as 2XX.
Cloudflare previewTorn down — the PR is closed. |
Greptile SummaryFixes silent loss of response bodies for Microsoft Graph operations by teaching
Confidence Score: 4/5Safe to merge. The two-line change in extract.ts is straightforward and the Graph normalization transform is pure and narrowly scoped to octet-stream success responses. The core logic is correct and well-tested. The only follow-up is a stale comment in The comment at line 147 in Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[streamOperationBindingsFromStructure] --> B[keptPathItem per range]
B --> C{keepPathItem defined?}
C -- "No (old full-graph)" --> D[rawValue as-is]
C -- "Yes (all selections now)" --> E[microsoftGraphKeepPathItem]
E --> F{coversFullGraph?}
F -- Yes --> G[pathItem unchanged]
F -- No --> H[filterPathItem\nscope/tag/path filter]
H --> I{kept?}
I -- null --> J[skip path-item]
I -- kept --> K[normalizeMicrosoftGraphContentPathItem]
G --> K
K --> L{octet-stream with\nnon-binary schema?}
L -- Yes --> M[rewrite to type:string format:binary]
L -- No --> N[leave untouched]
M --> O[extractResponseBody]
N --> O
O --> P{responses key order}
P --> Q[exact 2xx codes]
P --> R[wildcard 2XX - new tier]
P --> S[default]
Q --> T{schema found?}
R --> T
S --> T
T -- Yes --> U[OperationResponseBody with binaryResponse hint]
T -- No --> V[undefined]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[streamOperationBindingsFromStructure] --> B[keptPathItem per range]
B --> C{keepPathItem defined?}
C -- "No (old full-graph)" --> D[rawValue as-is]
C -- "Yes (all selections now)" --> E[microsoftGraphKeepPathItem]
E --> F{coversFullGraph?}
F -- Yes --> G[pathItem unchanged]
F -- No --> H[filterPathItem\nscope/tag/path filter]
H --> I{kept?}
I -- null --> J[skip path-item]
I -- kept --> K[normalizeMicrosoftGraphContentPathItem]
G --> K
K --> L{octet-stream with\nnon-binary schema?}
L -- Yes --> M[rewrite to type:string format:binary]
L -- No --> N[leave untouched]
M --> O[extractResponseBody]
N --> O
O --> P{responses key order}
P --> Q[exact 2xx codes]
P --> R[wildcard 2XX - new tier]
P --> S[default]
Q --> T{schema found?}
R --> T
S --> T
T -- Yes --> U[OperationResponseBody with binaryResponse hint]
T -- No --> V[undefined]
Reviews (1): Last reviewed commit: "fix(openapi): extract success responses ..." | Re-trigger Greptile |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 0eb1438 | Jul 02 2026, 10:22 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 0eb1438 | Commit Preview URL Branch Preview URL |
Jul 02 2026, 10:21 PM |
Microsoft Graph's OpenAPI spec declares every success response under the OpenAPI wildcard status key
2XX— 13k+ occurrences, with no numeric200/201keys anywhere in the 37MB document. The extractor's success-response filter only matched exact/^2\d\d$/codes, so no response body (and no file hint) was ever extracted for any Graph operation.Concretely: drive item content downloads (
drivesGetItemsContent,/me/drive/items/{id}/content) already carryformat: binaryin Microsoft's spec, but the missing 2XX handling meant thebinaryResponsehint never surfaced, so binary bodies were returned as lossy text instead of ToolFile artifacts.Changes:
extractResponseBodynow accepts wildcard2XXkeys, ranked after exact 2xx codes and beforedefault.type: objectwith avalueproperty there) totype: string, format: binary, and full-graph selections now flow through the same path-item transform.binaryResponsefile hint, plus a focused extractor test in the openapi package.2XX(previously silently dropped).Note for deployment: compiled bindings are persisted at spec registration time, so existing registered Microsoft Graph integrations need a spec refresh/re-registration to pick up the fix.