Skip to content

fix: resolve $ref schemas for query and header param coercion#15

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

fix: resolve $ref schemas for query and header param coercion#15
maxholman merged 1 commit intoblock65:masterfrom
maxholman:fix/ref-query-header-coercion

Conversation

@maxholman
Copy link
Copy Markdown
Contributor

Summary

  • When a query/header param schema is a $ref (e.g., $ref: "#/components/schemas/ExpireTime" with type: "integer"), resolve it inline so the string-to-number coercion pipeline applies
  • Previously the $ref was passed through unchanged, generating v.number() which rejected string values from HTTP query strings
  • Component schema (expireTimeSchema) stays as v.number() (correct for non-HTTP contexts); only the query/header param schema gets coercion

Test plan

  • Test updated: exp query param now uses $ref to ExpireTime component schema
  • Snapshot confirms coercion pipeline: v.string() → v.digits() → v.transform(parseInt) → v.number()
  • All 8 tests pass

🤖 Generated with Claude Code

When a query or header param schema is a $ref to a component schema
(e.g., ExpireTime with type: "integer"), the ref was passed through
unchanged to the valibot generator which emitted v.number() — failing
on string values from HTTP. Now $ref schemas are resolved inline for
query/header params so the string-to-number coercion pipeline applies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maxholman maxholman merged commit 59fe1ed 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