#1585·valibot

Add JsonValue schema

Author: vladshcherbinCreated Aug 9, 2026Updated Sep 3, 2026
Labelsenhancement

Would be nice to have:

typescript
export type JsonValue = string | number | boolean | null | { [key: string]: JsonValue } | JsonValue[]

const jsonValue: GenericSchema<JsonValue> = lazy(() => (
  union([string(), number(), boolean(), null_(), record(string(), jsonValue), array(jsonValue)])
))

Related: