Skip to content

Commit 318cb7e

Browse files
committed
add new schema component page
1 parent 5116a4a commit 318cb7e

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

fern/products/docs/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ navigation:
9494
- page: Runnable endpoint
9595
path: ./pages/component-library/default-components/runnable-endpoint.mdx
9696
icon: fa-duotone fa-play-circle
97+
- page: Schema
98+
path: ./pages/component-library/default-components/schema.mdx
99+
icon: fa-duotone fa-brackets-curly
97100
- page: Step
98101
path: ./pages/component-library/default-components/steps.mdx
99102
icon: fa-duotone fa-list-ol
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Schema
3+
description: Display any type definition from your API Reference
4+
---
5+
6+
The `<Schema>` component displays type definitions from your API Reference. Use it to render any type schema directly in your documentation pages, making it easy to reference data models, request objects, or response types throughout your docs.
7+
8+
This component is similar to [`<EndpointSchemaSnippet>`](/docs/writing-content/components/endpoint-schema-snippet), but accepts any type name rather than being limited to endpoint-specific schemas.
9+
10+
Before using the `<Schema>` component, you must reference the API in your `docs.yml` file:
11+
12+
```yaml docs.yml
13+
- api: API reference
14+
api-name: docs-yml
15+
```
16+
17+
<Note>
18+
The Schema component can only discover types that are referenced by endpoints in your API definition. Types exclusively referenced by websockets/webhooks or types that aren't referenced at all won't be available.
19+
</Note>
20+
21+
## Usage
22+
23+
<div className="highlight-frame">
24+
<Schema type="AIChatConfig" />
25+
</div>
26+
27+
```jsx Markdown
28+
<Schema type="AIChatConfig" />
29+
```
30+
31+
## Properties
32+
33+
<ParamField path="type" type="string" required={true}>
34+
The name of the type to display. The component will search for this type across all endpoints in your API definition.
35+
</ParamField>
36+
37+
<ParamField path="className" type="string" required={false}>
38+
Optional CSS class name for custom styling.
39+
</ParamField>

0 commit comments

Comments
 (0)