Skip to Content

Options

The plugin options.

OptionValuesDefaultDescription
libvalibot, zod, zod-minirequiredThe schema library to generate for.
unsupportedskip, errorskipWhat to do with a rule that the plugin cannot translate.

The plugin also accepts the standard options of protobuf-es plugins, such as target and import_extension.

unsupported

With unsupported=skip, the plugin leaves the rule out and writes a comment at the top of the generated file.

// Skipped unsupported rule on example.v1.User.name: cel

With unsupported=error, generation fails and lists each unsupported rule. Use it in CI to find a rule that the client does not check.

These rules are unsupported.

  • cel and cel_expression on a field or a message, and predefined rules.
  • (buf.validate.message).oneof.
  • The rules of Timestamp, Duration, Any, and FieldMask.
  • String formats without a standard action in both libraries, such as hostname, ip, uri_ref, and address.
  • bytes rules other than len, min_len, and max_len.
  • repeated.unique on bytes.
  • A numeric range whose upper bound is below its lower bound.
  • A pattern that the JavaScript RegExp cannot compile.