Skip to content

fix: coerce integer query and header params from strings#14

Merged
maxholman merged 1 commit intoblock65:masterfrom
maxholman:fix/query-header-integer-coercion
Apr 9, 2026
Merged

fix: coerce integer query and header params from strings#14
maxholman merged 1 commit intoblock65:masterfrom
maxholman:fix/query-header-integer-coercion

Conversation

@maxholman
Copy link
Copy Markdown
Contributor

Summary

  • Query and header params with type: "integer" now coerce from strings via the existing v.string() → v.digits() → v.transform(parseInt) → v.number() pipeline
  • Previously type: "integer" generated v.number() which rejected string values from HTTP query strings and headers
  • Reuses existing coercion logic by rewriting integer schemas to type: "string", format: "int64" for query/header param contexts

Test plan

  • New test: query and header integer params coerce strings to numbers
  • All 8 tests pass

🤖 Generated with Claude Code

Query and header params arrive as strings from HTTP. When the schema
declares type: "integer", rewrite to type: "string" with int format
so the existing string→number coercion pipeline (v.string() → v.digits()
→ v.transform(parseInt) → v.number()) handles parsing and validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maxholman maxholman merged commit d9c8e2b into block65:master Apr 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant