Skip to content

fix: catch raw JSON middleware responses#162

Open
kpassito wants to merge 2 commits into
tscircuit:mainfrom
kpassito:fix-middleware-raw-json-guidance
Open

fix: catch raw JSON middleware responses#162
kpassito wants to merge 2 commits into
tscircuit:mainfrom
kpassito:fix-middleware-raw-json-guidance

Conversation

@kpassito
Copy link
Copy Markdown

@kpassito kpassito commented May 27, 2026

Summary

  • Adds raw object response guidance for route, route middleware, and public makeRequest middleware returns.
  • Preserves valid Response / ctx.json middleware short-circuits by serializing makeRequest middleware responses with a permissive schema.
  • Adds focused regression coverage for raw object route/middleware returns, ctx.json from makeRequest middleware, and raw object makeRequest middleware rejection.

/claim #30

Verification

  • ./node_modules/.bin/ava tests/bundling/make-request/make-request.test.ts tests/errors/do-not-allow-raw-json.test.ts
  • ./node_modules/.bin/prettier --check src/types/winter-spec.ts tests/bundling/make-request/make-request.test.ts tests/errors/do-not-allow-raw-json.test.ts
  • git diff --check
  • GitHub Actions: Run Tests with Bun passed on ed6a84a

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@kpassito kpassito force-pushed the fix-middleware-raw-json-guidance branch from a8e9910 to ed6a84a Compare May 27, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant