Back to Kibana

Helpers and utilities for Zod

src/platform/packages/shared/kbn-zod-helpers/README.md

9.4.0717 B
Original Source

Helpers and utilities for Zod

Zod is a schema validation library with static type inference for TypeScript.

Helpers defined in this package:

  • Can be used in other packages and plugins to make it easier to define schemas with Zod, such as API schemas.
  • Are already used in src/platform/packages/shared/kbn-openapi-generator.
  • Are already used in x-pack/solutions/security/plugins/security_solution.

When you add some helper code to this package, please make sure that:

  • The code is generic and domain-agnostic (doesn't "know" about any domains such as Security or Observability).
  • The code is reusable and there are already a few use cases for it. Try to not generalize prematurely.