Skip to content

fix: reject symbol route returns#154

Open
Qian001A wants to merge 1 commit into
tscircuit:mainfrom
Qian001A:codex/symbol-route-return-guidance-30
Open

fix: reject symbol route returns#154
Qian001A wants to merge 1 commit into
tscircuit:mainfrom
Qian001A:codex/symbol-route-return-guidance-30

Conversation

@Qian001A
Copy link
Copy Markdown

@Qian001A Qian001A commented May 22, 2026

/claim #30

Summary

  • reject Symbol values returned directly from route handlers with ctx.json guidance
  • keep response validation error formatting stable when it wraps a non-Zod Error
  • add a focused regression test for the symbol-return path

Why

Returning a Symbol currently falls through the serializer and produces a low-level JavaScript error from the JavaScript in operator. This gives users a direct, actionable message for that unsupported route return value.

Validation

  • npx ava tests/errors/do-not-allow-raw-json.test.ts --verbose
  • npx prettier --check src/create-with-winter-spec.ts src/lib/format-zod-error.ts tests/errors/do-not-allow-raw-json.test.ts
  • 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