Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions fern/products/docs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ navigation:
- page: Runnable endpoint
path: ./pages/component-library/default-components/runnable-endpoint.mdx
icon: fa-duotone fa-play-circle
- page: Schema
path: ./pages/component-library/default-components/schema.mdx
icon: fa-duotone fa-brackets-curly
- page: Step
path: ./pages/component-library/default-components/steps.mdx
icon: fa-duotone fa-list-ol
Expand Down Expand Up @@ -302,4 +305,7 @@ navigation:
- page: Stainless vs. Fern
path: ./pages/resources/stainless-comparison.mdx
slug: stainless-comparison
# must be included to use the schema component
- api: API reference
api-name: docs-yml

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Schema
description: Display any type definition from your API Reference
---

The `<Schema>` component displays type definitions from your API Reference anywhere in your documentation. Use it to reference data models, request objects, or response types outside of your API Reference pages.

Similar to [`<EndpointSchemaSnippet>`](/docs/writing-content/components/endpoint-schema-snippet), but accepts any type name rather than being limited to endpoint-specific schemas. The component only discovers types referenced by endpoints. Types exclusively used by websockets/webhooks won't be available.

## Usage

<Info>
Before using the `<Schema>` component, you must reference the API in your `docs.yml` file:

```yaml docs.yml
- api: API reference
api-name: docs-yml
```
</Info>

<div className="highlight-frame">
<div className="highlight-frame-content">
<Schema type="AIChatConfig" />
</div>
</div>

```jsx Markdown
<Schema type="AIChatConfig" />
```

## Properties

<ParamField path="type" type="string" required={true}>
The name of the type to display. The component will search for this type across all endpoints in your API definition.
</ParamField>

<ParamField path="className" type="string" required={false}>
Optional CSS class name for custom styling.
</ParamField>
Loading
Loading