> 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 any value, optionally constrained by anyOf or choices.

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       # ✗ mismatched-choice
```

## Optional, nullable & defaults

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

## 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
