Skip to content

API reference > @kontsedal/olas-core > StandardSchemaV1

StandardSchemaV1 type ​

Standard Schema v1 — the cross-library validation contract adopted by Zod 4, Valibot 1, ArkType 2, and others. See https://standardschema.dev.`I` is the schema's input type and O its output type.

We type-only-import the shape so consumers don't take a new runtime dep: any object with a ~standard.validate(value) method conforming to this structure works. validator(schema) wraps one as a Validator.

Signature:

typescript
type StandardSchemaV1<I = unknown, O = I> = {
  readonly '~standard': {
    readonly version: 1;
    readonly vendor: string;
    validate(value: unknown): StandardSchemaV1Result<O> | Promise<StandardSchemaV1Result<O>>;
    readonly types?: {
      readonly input: I;
      readonly output: O;
    } | undefined;
  };
};

References: StandardSchemaV1Result

Released under the MIT License.