// 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' })
}
};
Schema definition for validating request properties.
Can be either:
TObjectschema wrapping all validation targetsEach property can be:
TSchema(e.g.,Type.Object(...),Type.String()){ name: Type.String() })