Skip to content

Compatibility with standard-schema #14539

Open
@BrunnerLivio

Description

@BrunnerLivio

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

There are numerous schema validators out there. This has spawned an ecosystem around NestJS with various integrations such as nestjs-valibot and many others.

Describe the solution you'd like

NestJS could support stanadard-schema which recently hit 1.0.0:

Standard Schema is a common interface designed to be implemented by JavaScript and TypeScript schema libraries.

With that a commonly shared ValidationPipe could be offered directly from the framework instead of copy/pasting the integrations from the docs site.

Teachability, documentation, adoption, migration strategy

Guide on how to accept Standard Schema: https://standardschema.dev/#how-do-i-accept-standard-schemas-in-my-library

  • Offer a general ValidationPipe that is compatible with standard-schema
  • Update the docs how the ValidationPipe can be utilised with different schema libraries

What is the motivation / use case for changing the behavior?

I think it makes NestJS more future-proof with any future schema/validation library that might come

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions