schema-components - v3.7.0
    Preparing search index...

    Interface LiteralField

    Properties common to every WalkedField variant. The type field acts as the discriminant for the tagged union.

    interface LiteralField {
        editability: Editability;
        meta: SchemaMeta;
        isOptional?: boolean;
        isNullable?: boolean;
        defaultValue?: unknown;
        examples?: unknown[];
        type: "literal";
        constraints: Record<string, never>;
        literalValues: unknown[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    editability: Editability
    isOptional?: boolean

    Whether the field is optional (not in required).

    isNullable?: boolean

    Whether the field is nullable (anyOf [T, null] or type: ["...", "null"]).

    defaultValue?: unknown

    Default value from the schema's default keyword.

    examples?: unknown[]

    Example values from the schema's examples keyword.

    type: "literal"
    constraints: Record<string, never>
    literalValues: unknown[]

    Const values from JSON Schema const. Per Draft 2020-12 §6.1.3, const accepts any JSON value (object or array included), not only primitives. The walker emits a single-element array because const is scalar by definition; the field shape mirrors EnumField for renderer symmetry.