jsonFieldToInputSchema
jsonFieldToInputSchema(
props):ZodType
Defined in: packages/core/src/fields/json/inputSchema.ts:25
Builds a Zod schema for validating a json field value in the admin form.
There is no shape validation — any JSON-serializable value passes. A
required field rejects undefined/null with “This field is required.”;
a non-required field accepts a missing value and falls back to
field.defaultValue.
Parameters
Section titled “Parameters”Input props.
The resolved json field definition
Returns
Section titled “Returns”ZodType
A Zod schema accepting any defined, non-null value when required
Example
Section titled “Example”const field = json({ required: true })jsonFieldToInputSchema({ field })// → z.unknown().refine(...) — rejects undefined/null with "This field is required."