The <SchemaSnippet> component displays type definitions from your API Reference as a JSON code block. Use it on its own to display the JSON representation, or pair it with the <Schema> component to show both the field-by-field breakdown and JSON together. When AI agents fetch the Markdown version of a page, the JSON code block is included as a fenced code block in the Markdown output.
The component only discovers types referenced by endpoints. Types exclusively used by websockets or webhooks won’t be available. If multiple APIs have the same type name, the component returns the first match.
The component works with API references already configured in your docs.yml. This example displays the AIChatConfig type as a JSON code block:
Use <SchemaSnippet> alongside <Schema> to display both the JSON representation and the detailed field breakdown:
The name of the type to display. The component searches for this type across all endpoints in your API definition.
Optional title displayed above the JSON code block.
Optional CSS class name for custom styling.
Line numbers to highlight in the code snippet. Accepts a single number, an array of numbers, or ranges (e.g., {[1-3, 5]}).