For the complete documentation index, see llms.txt. This page is also available as Markdown.

Bool

The bool type — true/false values.

The bool type validates a boolean value. In data it is written compactly as T/F or verbosely as true/false.

For the boolean value syntax, see Booleans.

TypeDef

A bool MemberDef accepts only the options below. Any other key is invalid.

Option
Type
Description

type

string

The type name bool. First positional value.

default

bool

Value used when the member is omitted. Second positional value.

optional

bool

If true, the member may be omitted. Shorthand: ? suffix on the key.

null

bool

If true, the member may be null. Shorthand: * suffix on the key.

Examples

active: bool
---
~ T        # ✓ true
~ false    # ✓
~ yes      # ✗ expected-boolean

Optional with a default:

verified?: { bool, T }    # optional; defaults to true when omitted
---
~ {}        # ✓ verified resolves to T
~ F         # ✓ verified is F

Nullable:

Optional, nullable & defaults

Input
Result

T/true/F/false

the boolean

any other token

expected-boolean error

N, key nullable (*)

null

N, not nullable

forbidden-null error

omitted, default set

the default

omitted, optional (?), no default

absent

omitted, required

missing-value error

See Also

Last updated

Was this helpful?