Skip to content

feat: use standard schema for query param schema option #246

Description

@danielwaltz

Which @signality/* package(s) are relevant/related to the feature request?

core

Description

Hello!

I was working to integrate a schema with the queryParams schema option using Valibot and ran into an issue where the shape of a Valibot schema does not align with Zod's chained MySchema.parse(input) method because Valibot uses a different shape of v.parse(MySchema, input).

An initiative called StandardSchema was created to allow interop between libraries that support it.

Proposed solution

I would propose this be adopted so any schema validation library can be used natively.

Thanks!

Alternatives considered

A workaround for this is possible by manually matching Zod's shape:

queryParams({ schema: { parse: (input) => v.parse(MySchema, input) } })

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions