Versioned API schema
GitHub REST API code scanning analyses sarif content type application/sarif+json
Code-scanning download succeeds but client rejects `application/sarif+json` as unexpected.
Agent Quick Fix
Repair against the current GitHub REST API contract, then keep the change narrow and source-backed.
Product: GitHub REST API
Current-contract area: SARIF response Content-Type correction breaks strict old assertion
Likely root cause: Code-scanning download succeeds but client rejects `application/sarif+json` as unexpected.
Repair direction: Verifier exercises the changed field/status/enum plus an unaffected endpoint to prevent a brittle one-off patch. Exercise strict and permissive parsing plus one downstream behavior tied to the changed field.
Symptom
Code-scanning download succeeds but client rejects `application/sarif+json` as unexpected.
Why This Happens
Several historical response shapes are locally plausible; only the selected current API version determines fields, enums, media types, and status codes.
Common Wrong Fixes
- Changing local code without checking the current external contract.
- Retrying the same install, build, or API call with no version/source change.
- Applying a broad unsafe bypass when a narrow compatibility fix is available.
Codex Search Keywords
These are the search terms observed in a neutral Codex validation run for this failure shape.
GitHub REST API code scanning analyses sarif content type application/sarif+json
site:docs.github.com REST code scanning analyses download SARIF application/sarif+json
GitHub REST API get code scanning analysis sarif media type
https://docs.github.com/en/rest/code-scanning/code-scanning?apiVersion=2022-11-28
'application/sarif' in https://docs.github.com/en/rest/code-scanning/code-scanning?apiVersion=2022-11-28
Source Trail
GitHub source file/reference: