@novice1/validator-typebox - v1.0.0
    Preparing search index...

    Type Alias ValidatorTypeboxSchema

    ValidatorTypeboxSchema:
        | TObject
        | {
            body?: TSchema
            | { [x: string]: TSchema };
            cookies?: TSchema | { [x: string]: TSchema };
            files?: TSchema | { [x: string]: TSchema };
            headers?: TSchema | { [x: string]: TSchema };
            params?: TSchema | { [x: string]: TSchema };
            query?: TSchema | { [x: string]: TSchema };
        }

    Schema definition for validating request properties.

    Can be either:

    • A TypeBox TObject schema wrapping all validation targets
    • An object where each property defines validation for a specific request property

    Each property can be:

    • A TypeBox TSchema (e.g., Type.Object(...), Type.String())
    • A plain object with TypeBox schemas as values (e.g., { name: Type.String() })
    // Method 1: TObject wrapper
    const schema: ValidatorTypeboxSchema = Type.Object({
    body: Type.Object({ name: Type.String() })
    });

    // Method 2: Plain object with TSchema
    const schema: ValidatorTypeboxSchema = {
    body: Type.Object({ name: Type.String() }),
    query: Type.Object({ page: Type.String() })
    };

    // Method 3: Plain object with TypeBox schema values
    const schema: ValidatorTypeboxSchema = {
    body: {
    name: Type.String(),
    email: Type.String({ format: 'email' })
    }
    };