Skip to content

fix: guard serializer-shaped raw route objects#155

Open
matcldr wants to merge 1 commit into
tscircuit:mainfrom
matcldr:codex/winterspec-raw-serializer-object
Open

fix: guard serializer-shaped raw route objects#155
matcldr wants to merge 1 commit into
tscircuit:mainfrom
matcldr:codex/winterspec-raw-serializer-object

Conversation

@matcldr
Copy link
Copy Markdown

@matcldr matcldr commented May 22, 2026

/claim #30

Summary

  • catch raw object route returns before response serialization inspects framework response markers
  • preserve the existing ctx.json({...}) guidance for JSON-shaped objects that contain fields like serializeToResponse
  • keep valid native Response and ctx.json(...)/WinterSpecResponse returns unchanged

Validation

  • npx ava tests/errors/do-not-allow-raw-json.test.ts --verbose
  • npx prettier --check src/create-with-winter-spec.ts src/middleware/with-response-object-check.ts tests/errors/do-not-allow-raw-json.test.ts
  • npm run typecheck
  • git diff --check

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