@servicenow/sdk - v4.14.3
    Preparing search index...
    interface JSONSchemaGeneratorParams {
        cycles?: "throw" | "ref";
        external?: {
            defs: Record<string, BaseSchema>;
            registry: $ZodRegistry<{ id?: string }>;
            uri?: (id: string) => string;
        };
        io?: "output"
        | "input";
        metadata?: $ZodRegistry<
            Record<string, any>,
            $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
        >;
        override?: (
            ctx: {
                jsonSchema: JSONSchema;
                path: (string | number)[];
                zodSchema: $ZodTypes;
            },
        ) => void;
        processors: Record<string, Processor>;
        reused?: "inline" | "ref";
        target?:
            | "draft-04"
            | "draft-07"
            | "draft-2020-12"
            | "openapi-3.0"
            | {} & string;
        unrepresentable?: "any"
        | "throw"
        | UnrepresentableHandler<$ZodTypes>;
    }
    Index

    Properties

    cycles?: "throw" | "ref"
    external?: {
        defs: Record<string, BaseSchema>;
        registry: $ZodRegistry<{ id?: string }>;
        uri?: (id: string) => string;
    }
    io?: "output" | "input"

    Whether to extract the "input" or "output" type. Relevant to transforms, defaults, coerced primitives, etc.

    • "output" — Default. Convert the output schema.
    • "input" — Convert the input schema.
    metadata?: $ZodRegistry<
        Record<string, any>,
        $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
    >

    A registry used to look up metadata for each schema. Any schema with an id property will be extracted as a $def.

    globalRegistry
    
    override?: (
        ctx: {
            jsonSchema: JSONSchema;
            path: (string | number)[];
            zodSchema: $ZodTypes;
        },
    ) => void

    Arbitrary custom logic that can be used to modify the generated JSON Schema.

    processors: Record<string, Processor>
    reused?: "inline" | "ref"
    target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | {} & string

    The JSON Schema version to target.

    • "draft-2020-12" — Default. JSON Schema Draft 2020-12
    • "draft-07" — JSON Schema Draft 7
    • "draft-04" — JSON Schema Draft 4
    • "openapi-3.0" — OpenAPI 3.0 Schema Object
    unrepresentable?: "any" | "throw" | UnrepresentableHandler<$ZodTypes>

    How to handle unrepresentable types.

    • "throw" — Default. Unrepresentable types throw an error
    • "any" — Unrepresentable types become {}
    • A function — called once per unrepresentable schema; see UnrepresentableHandler.