description

Creates a description metadata action.

const Action = v.description<TInput, TDescription>(description_);

Generics

  • TInput extends any
  • TDescription extends string

Parameters

  • description_ TDescription

Explanation

With description you can describe the purpose of a schema. This can be useful when working with AI tools or for documentation purposes.

Returns

Examples

The following examples show how description can be used.

Username schema

Schema to validate a user name.

const UsernameSchema = v.pipe(
  v.string(),
  v.regex(/^[a-z0-9_-]{4,16}$/iu),
  v.title('Username'),
  v.description(
    'A username must be between 4 and 16 characters long and can only contain letters, numbers, underscores and hyphens.'
  )
);

The following APIs can be combined with description.

Schemas

Methods

Utils

Contributors

Thanks to all the contributors who helped make this page better!

  • GitHub profile picture of fabian-hiller

Partners

Thanks to our partners who support the project ideally and financially.

Sponsors

Thanks to our GitHub sponsors who support the project financially.

  • GitHub profile picture of Thanaen
  • GitHub profile picture of osdiab
  • GitHub profile picture of ruiaraujo012
  • GitHub profile picture of hyunbinseo
  • GitHub profile picture of F0rce
  • GitHub profile picture of fabulousgk
  • GitHub profile picture of caegdeveloper
  • GitHub profile picture of andrew-d-jackson
  • GitHub profile picture of dslatkin