Schemas
Boolean

Boolean

Validate boolean values with optional coercion.

Parameters

  • options?: table
    • required_error?: string
      • Custom required message
    • type_error?: string
      • Custom invalid type message
local superUser = calid:string({
    required_error = "Super user is required",
    type_error = "Super user must be a boolean"
})

Options

  • :default(value) – Specifies a fallback value when the input is nil. Useful for optional fields with defaults.
  • :optional() – Allows nil as a valid value without causing a validation error.
  • :coerce() – Converts strings ("true"/"1") or numbers to boolean (non-zero = true).