# Schema budget

Bound recursive OpenAPI schema data for predictable content builds.

import { Callout } from '@prosefly/astro-components';

Large OpenAPI documents can contain recursive or very deeply nested schemas.
Astro OpenAPI stores bounded, JSON-safe schema data in the content layer so a
single specification cannot expand without limit during a build.

Configure the budget only when the default is not a good fit:

```ts
openApiLoader({
  schemaBudget: {
    maxDepth: 8,
    maxArrayItems: 20,
    maxObjectEntries: 60,
    maxNodes: 1200,
  },
});
```

| Option | Controls |
| --- | --- |
| `maxDepth` | Maximum nested schema depth |
| `maxArrayItems` | Maximum items retained from an array schema |
| `maxObjectEntries` | Maximum properties retained from an object schema |
| `maxNodes` | Overall node budget for one normalized schema |

<Callout type="tip" title="Increase gradually">
  Start with the defaults. Increase one limit at a time when a specific API
  reference needs more detail, then verify the build output and page size.
</Callout>
