Bool
The bool type — true/false values.
Last updated
Was this helpful?
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.
A bool MemberDef accepts only the options below. Any other key is invalid.
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.
active: bool
---
~ T # ✓ true
~ false # ✓
~ yes # ✗ not-a-boolOptional with a default:
verified?: { bool, T } # optional; defaults to true when omitted
---
~ {} # ✓ verified resolves to T
~ F # ✓ verified is FNullable:
T/true/F/false
the boolean
any other token
not-a-bool error
N, key nullable (*)
null
N, not nullable
null-not-allowed error
omitted, default set
the default
omitted, optional (?), no default
absent
omitted, required
value-required error
Use the
*suffix for nullability. The keyednull:option is part of the TypeDef but is not currently honored — see Implementation status.
Keyed optional: works; keyed null: is not yet honored — use the * suffix.
Last updated
Was this helpful?
Was this helpful?
flag*: bool # nullable (value may be N)
---
~ N # ✓ null
~ T # ✓