Documentation
    Preparing search index...

    Interface IAnyOf

    Union type schema (A | B | C).

    Represents a TypeScript union type where the value can match any one of the member schemas. Note: Gemini does not support anyOf/oneOf schemas. Use discriminated unions with x-discriminator when possible for better LLM comprehension.

    interface IAnyOf {
        anyOf: (
            | ILlmSchema.IBoolean
            | ILlmSchema.IInteger
            | ILlmSchema.INumber
            | ILlmSchema.IString
            | ILlmSchema.IArray
            | ILlmSchema.IObject
            | ILlmSchema.IReference
            | ILlmSchema.INull
            | ILlmSchema.IUnknown
        )[];
        deprecated?: boolean;
        description?: string;
        example?: any;
        examples?: Record<string, any>;
        readOnly?: boolean;
        title?: string;
        writeOnly?: boolean;
        "x-discriminator"?: ILlmSchema.IAnyOf.IDiscriminator;
    }

    Hierarchy (View Summary)

    Index

    Properties

    anyOf: (
        | ILlmSchema.IBoolean
        | ILlmSchema.IInteger
        | ILlmSchema.INumber
        | ILlmSchema.IString
        | ILlmSchema.IArray
        | ILlmSchema.IObject
        | ILlmSchema.IReference
        | ILlmSchema.INull
        | ILlmSchema.IUnknown
    )[]

    Array of possible schemas.

    The value must match at least one of these schemas. Nested anyOf schemas are flattened to avoid deep nesting.

    deprecated?: boolean

    Whether this type is deprecated.

    When true, indicates the type should no longer be used and may be removed in future versions. Set via the @deprecated JSDoc tag.

    description?: string

    Detailed description of the schema.

    Full documentation for the type, explaining its purpose, constraints, and usage. Extracted from JSDoc comment body. Supports markdown formatting in many JSON Schema consumers.

    example?: any

    Single example value for the schema.

    A representative value that conforms to the schema, useful for documentation and testing. Set via the @example JSDoc tag.

    examples?: Record<string, any>

    Named example values for the schema.

    Multiple examples as key-value pairs, where keys are example names and values are conforming data. Useful for showing different valid states or edge cases.

    readOnly?: boolean

    Whether the property is read-only.

    When true, the property should not be modified by clients and is typically set by the server. Useful for generated IDs, timestamps, etc.

    title?: string

    Short title for the schema.

    A brief, human-readable name for the type. Typically extracted from the first line of a JSDoc comment or the @title tag.

    writeOnly?: boolean

    Whether the property is write-only.

    When true, the property is accepted on input but never returned in responses. Common for sensitive data like passwords.

    "x-discriminator"?: ILlmSchema.IAnyOf.IDiscriminator

    Discriminator for tagged/discriminated unions.

    Helps LLMs understand which variant to select based on a discriminating property value. Improves type inference accuracy.