Skip to content
Published beta · latest tagRead as Markdown

Find your adapter ​

Start with the schema and behavior you already use. Mimlet keeps the core small; generation and native library integrations are opt-in.

Your input or jobPackageWhat to expect
A factory or Standard Schema validator@mimlet/coreImmutable builders, input/output typing, async capabilities, sessions and scenarios; provide the factory.
Modern typebox@mimlet/typeboxNative creation, checking and codecs; explicit factory escape hatch.
@sinclair/typebox@mimlet/typebox-legacyNative legacy TypeBox and Transform semantics.
JSON Schema or Standard JSON Schema conversion@mimlet/json-schemaSupported draft validation, profiles and bounded generation; inspect unsupported capabilities.
Zod 4 / Zod Mini@mimlet/zodNative parsing/codecs, explicit async validation, input generation and factories.
ArkType@mimlet/arktypeNative morphs/scopes, input checks, input generation and factories.
Valibot@mimlet/valibotInput conversion plus native parsing; factories for unsupported refinements.
class-validator DTOs (NestJS)@mimlet/class-validatorPayloads for e2e tests and the DTO instances ValidationPipe produces; factories provide the values.
Effect 4 (Effect 3 through alpha.3)@mimlet/effectNative schemas, codecs, arbitraries and shrinking.
Realistic values@mimlet/fakerExplicit session-scoped randomness, locale and reference date.
Property tests@mimlet/fast-checkNative shrinking, scenario recomputation and checked replay.
OpenAPI / AsyncAPI@mimlet/apiOperation/message fixtures and explicit serialization with offline references.
GraphQL@mimlet/graphqlNative input fixtures and selection-aware response fixtures.
Protobuf@mimlet/protobufNative values, offline imports and binary codecs.
Avro@mimlet/avroNative values, unions, 64-bit integers and binary codecs.
Generated fluent builders@mimlet/codegenDeterministic classes, CLI checks, optional self-contained runtime.
A local schema editor@mimlet/playgroundLoopback-only playground with bounded, interruptible workers.
Your own adapter@mimlet/adapterCapability inspection and reusable conformance checks.
UI previews, HTTP mocks, test persistence@mimlet/consumersExplicit loaders, response resolvers and caller-owned persistence.
Hey API generationhey-api-buildersThe established plugin, now backed by the neutral core.

The dedicated Zod and ArkType adapters are included in 0.1.0-alpha.1. Follow the tested recipes, or retain the core and Standard JSON Schema path when those interfaces already meet your needs. The class-validator adapter was first published as 0.1.0-beta.4; see the NestJS DTO guide.

Validation, conversion and generation are different ​

Standard Schema describes validation and input/output types. It does not itself provide a generator or make arbitrary callbacks reversible. Conversion to JSON Schema can lose constraints that only the native validator understands.

Use buildValidated() or its async counterpart when decoded, validated output is required. Supply a factory when generation cannot faithfully express a constraint. Inspect the package's capabilities before claiming codec, generation or shrinking support. Pin the tested native-library versions in the compatibility matrix.

Realistic values for tests ​

Adapters that generate through JSON Schema (@mimlet/json-schema, @mimlet/zod, @mimlet/valibot, @mimlet/arktype, @mimlet/api and the JSON targets of @mimlet/codegen) default to the minimal profile: optional fields are left out and an unconstrained number can be anywhere in its range. profile: 'realistic' fills optional and nullable fields, keeps arrays at one to three items, draws unconstrained numbers from 1 to 100 within the schema's bounds and writes plain strings as readable words:

ts
import { z } from 'zod';
import { fromZod } from '@mimlet/zod';

const Order = z.object({
  reference: z.string(),
  total: z.number().nonnegative(),
  coupon: z.string().nullable().optional(),
  lines: z.array(
    z.object({
      sku: z.string().max(12),
      quantity: z.number().int().positive(),
      note: z.string().optional(),
    })
  ),
});

// The default profile leaves optional fields out and samples the whole safe-integer range.
export const minimal = fromZod(Order).build();
// realistic fills optional and nullable fields with readable words and small numbers.
export const realistic = fromZod(Order, { profile: 'realistic' }).build();

The profile is part of the replay identity, and every value still passes the schema. See realistic values for the exact rules. Fix the values a test depends on with .with().

Keep the meaningful relationships ​

Faker supplies realistic primitives. Mimlet builders fix the fields that matter; scenarios connect related records. For property tests, shrink independent inputs and recompute the dependent values. See the agent recipes for executable examples of these combinations.

Mimlet · beta · MIT licensed