Skip to content

v0.9.0

Choose a tag to compare

@briward briward released this 17 Feb 18:07
· 25 commits to main since this release

In this release

Significant changes made to the underlying foundation, meaning that users will be to upgrade from v0.8.x to v.0.9.0 with care.

  • Full support added for StandardSchemaV1, see https://standardschema.dev/schema.
  • Added new helper functions for building standard-schema compliant validators.
  • Updated all existing validation rules to be compliant with standard-schema/spec.

Upgrading from v0.8.x to v0.9.0

Old:

app.use((context: Context) => {
  await context.request.validate({
    name: "required|string",
    age: "required|numeric",
  });
});

New:

import { schema, rules } from "@raptor/validator";

app.use((context: Context) => {
  await context.request.validate(schema({
    name: rules<string>("required|string"),
    age: rules<number>("required|numeric"),
  }));
});

Existing standard-schema compliant validation libraries such as Zod and Valibot now work seamlessly with Raptor's built-in validator.