> 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/any.md).

# Any

The **`any`** type accepts a value of **any** type. It is the default when a field is declared without a type (`name` is the same as `name: any`). You can still narrow it with `choices` or, for a union of types, `anyOf`.

```ruby
a, b: any, c: { type: any }
---
~ hello, 42, T        # ✓ — anything goes
```

## Declaring alternatives (anyOf)

`anyOf` lets a field accept any one of several types or MemberDefs — Internet Object's union type.

```ruby
id: { any, anyOf: [string, int] }
---
~ 42        # ✓ matches int
~ abc       # ✓ matches string
```

```ruby
flag: { any, anyOf: [bool, int] }
---
~ hello     # ✗ matches neither
```

Each alternative may be a full MemberDef or a SchemaDef:

```ruby
value: { any, anyOf: [{ int, multipleOf: 5 }, { int, multipleOf: 3 }] }
---
~ 10        # ✓ multiple of 5
~ 9         # ✓ multiple of 3
```

## TypeDef

An `any` MemberDef accepts only the options below.

| Option     | Type                    | Description                                                  |
| ---------- | ----------------------- | ------------------------------------------------------------ |
| `type`     | string                  | The type name `any`.                                         |
| `default`  | any                     | Value used when the member is omitted.                       |
| `choices`  | array                   | Restricts the value to a fixed set (of any type).            |
| `anyOf`    | array of MemberDef/type | The value must match one of these.                           |
| `optional` | bool                    | If `true`, the member may be omitted. Shorthand: `?` suffix. |
| `null`     | bool                    | If `true`, the member may be `null`. Shorthand: `*` suffix.  |

## choices

```ruby
pick: { any, choices: [1, One, T] }
---
~ One       # ✓
~ Two       # ✗ invalid-choice
```

## Optional, nullable & defaults

```ruby
note?*: any
---
~ {}        # ✓ omitted → absent
~ N         # ✓ null
```

## Implementation status (beta)

* Keyed `null:` is not yet honored — use the `*` suffix.

## See Also

* [Union Types (anyOf)](/schema-definition-language/advanced-schema-concepts/union-types.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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
