Stone.js API
    Preparing search index...
    • The imperative counterpart of a schema class: a plain function returning the rules.

      It receives the same dependencies a class would get through its constructor, so it can reach the container's services too.

      Parameters

      Returns (dependencies: any) => IValidationSchema

      A schema instance.

      export const createUserSchema = defineValidationSchema(({ i18n }) => ({
      body: z.object({ email: z.string().email(i18n.t('validation.email')) })
      }))