> For the complete documentation index, see [llms.txt](https://docs.internetobject.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.internetobject.org/schema-definition-language/data-types/bool.md).

# Bool

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](/structure-and-syntax/values/booleans.md).

## 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

```ruby
active: bool
---
~ T        # ✓ true
~ false    # ✓
~ yes      # ✗ not-a-bool
```

Optional with a default:

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

Nullable:

```ruby
flag*: bool               # nullable (value may be N)
---
~ N         # ✓ null
~ T         # ✓
```

## Optional, nullable & defaults

| Input                               | Result                   |
| ----------------------------------- | ------------------------ |
| `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 keyed `null:` option is part of the TypeDef but is not currently honored — see *Implementation status*.

## Implementation status (beta)

* Keyed `optional:` works; keyed `null:` is not yet honored — use the `*` suffix.

## See Also

* [Booleans (value syntax)](/structure-and-syntax/values/booleans.md)
* [TypeDef](/schema-definition-language/advanced-schema-concepts/typedef.md) · [MemberDef](/schema-definition-language/advanced-schema-concepts/memberdef.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.internetobject.org/schema-definition-language/data-types/bool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
