Skip to content
Merged
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
4 changes: 4 additions & 0 deletions fern/products/api-def/openapi-pages/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ auth-schemes:

The `endpoint` values reference paths in your OpenAPI spec. When `expires-in` is returned, the SDK automatically refreshes tokens before they expire.

<Tip>
If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis) (multiple API specs), prefix the endpoint with the namespace and `::`. For example, `"payments::POST /oauth/token"`.
</Tip>

</Accordion>
</AccordionGroup>

2 changes: 1 addition & 1 deletion fern/products/api-def/pages/project-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ groups:
</Step>

<Step title="Add namespaces (optional)">
Add namespaces to handle overlapping schema names between APIs or to organize different API versions:
Add [`namespace`](/learn/sdks/reference/generators-yml#namespace) to handle overlapping schema names between APIs or to organize different API versions:

<Tabs>
<Tab title="Distinct APIs">
Expand Down
10 changes: 10 additions & 0 deletions fern/products/docs/pages/api-references/customize-api-ref.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ The `layout` option allows you to specify the order of sub-packages, sections, e
- store
- plant
```

If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix the endpoint with the namespace and `::`:
```yaml title="docs.yml"
navigation:
- api: API Reference
layout:
- payments::POST /user
- user
- store
```
</Tab>
<Tab title="Fern Definition">
```yaml title="docs.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ The `EndpointRequestSnippet` component includes a Try It button by default. Use
## Properties

<ParamField path="endpoint" type="string" required={true}>
The endpoint to display, in the format `METHOD /path` (e.g., `POST /chat/{domain}`).
The endpoint to display, in the format `METHOD /path` (e.g., `POST /chat/{domain}`). If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `payments::POST /chat/{domain}`).
</ParamField>

<ParamField path="example" type="string" required={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ your API Reference.
## Properties

<ParamField path="endpoint" type="string" required={true}>
The endpoint to display, in the format `METHOD /path` (e.g., `POST /chat/{domain}`).
The endpoint to display, in the format `METHOD /path` (e.g., `POST /chat/{domain}`). If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `payments::POST /chat/{domain}`).
</ParamField>

<ParamField path="example" type="string" required={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,13 @@ Passing `response` as the selector will only render the response schema.
```jsx Markdown
<EndpointSchemaSnippet endpoint="POST /chat/{domain}" selector="response.body" />
```

## Properties

<ParamField path="endpoint" type="string" required={true}>
The endpoint to display, in the format `METHOD /path` (e.g., `POST /chat/{domain}`). If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `payments::POST /chat/{domain}`).
</ParamField>

<ParamField path="selector" type="string" required={false}>
Selects a specific part of the endpoint schema to display. Supported values: `request`, `request.path`, `request.query`, `request.body`, `response`, `response.body`.
</ParamField>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The component supports:
## Properties

<ParamField path="endpoint" type="string" required={false}>
The endpoint locator in the format "METHOD /path". For example: `"POST /api/users"` or `"GET /api/users/{id}"`.
The endpoint locator in the format "METHOD /path". For example: `"POST /api/users"` or `"GET /api/users/{id}"`. If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `"payments::POST /api/users"`).
</ParamField>

<ParamField path="example" type="string" required={false}>
Expand Down
4 changes: 2 additions & 2 deletions fern/products/sdks/snippets/oauth-get-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ get-token:
```

<ParamField path="endpoint" type="string" required={true}>
The endpoint that issues access tokens, such as `'auth.get_token'`.
The endpoint that issues access tokens, such as `'auth.get_token'` or `'POST /oauth/token'`. If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `'payments::POST /oauth/token'`).
</ParamField>
<ParamField path="request-properties" type="object" required={false}>
Maps OAuth parameter names to your API's request field names. Use this when your token endpoint expects different field names than the OAuth standard (e.g., your API uses `clientId` instead of `client_id`).
Expand All @@ -37,4 +37,4 @@ get-token:
</ParamField>
<ParamField path="refresh-token" type="string" required={false}>
The response field name for the refresh token in your API (e.g., `"refreshToken"`, `"refresh_token"`). Required if using the `refresh-token` flow.
</ParamField>
</ParamField>
4 changes: 2 additions & 2 deletions fern/products/sdks/snippets/oauth-refresh-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ refresh-token:
```

<ParamField path="endpoint" type="string" required={true}>
The endpoint that refreshes access tokens (e.g., `"POST /oauth/refresh"` or `"auth.refreshToken"`).
The endpoint that refreshes access tokens (e.g., `"POST /oauth/refresh"` or `"auth.refreshToken"`). If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `"payments::POST /oauth/refresh"`).
</ParamField>
<ParamField path="request-properties" type="object" required={false}>
Maps OAuth parameter names to your API's request field names for the refresh flow.
Expand All @@ -30,4 +30,4 @@ refresh-token:
</ParamField>
<ParamField path="response-properties.refresh-token" type="string" required={false}>
The response field name if your API issues a new refresh token with each refresh (token rotation).
</ParamField>
</ParamField>
2 changes: 1 addition & 1 deletion fern/snippets/openapi-specs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ api:
</ParamField>

<ParamField path="settings.filter.endpoints" type="list of strings" toc={true}>
Endpoints to include in the generated SDK. Specify endpoints in the format `METHOD /path` (e.g., `POST /users`, `GET /users/{id}`). Only the listed endpoints will be included in the generated SDK; all other endpoints will be excluded.
Endpoints to include in the generated SDK. Specify endpoints in the format `METHOD /path` (e.g., `POST /users`, `GET /users/{id}`). Only the listed endpoints will be included in the generated SDK; all other endpoints will be excluded. If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `payments::POST /users`).
</ParamField>

<ParamField path="settings.example-generation.request.max-depth" type="integer" toc={true}>
Expand Down
Loading