Skip to content

Commit 9ae1c98

Browse files
authored
Merge branch 'main' into ask-fern-rbac-docs
2 parents f1c4e59 + 8968e64 commit 9ae1c98

File tree

73 files changed

+1139
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1139
-214
lines changed

fern/assets/styles.css

Lines changed: 141 additions & 85 deletions
Large diffs are not rendered by default.

fern/footer-dist/output.js

Lines changed: 37 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fern/products/api-def/ferndef-pages/webhooks.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,24 @@ You can inline the schema of the payload by doing the following:
6363
```
6464
</CodeBlock>
6565
66+
## Generate webhook reference
67+
68+
Fern Docs can automatically generate your webhook reference documentation from your definition. Set this up in your `docs.yml` file.
69+
70+
Your webhook reference can be a single documentation page:
71+
72+
```yml docs.yml
73+
navigation:
74+
- api: Webhook Reference # Display name for this page
75+
api-name: webhooks-v1 # Directory containing webhook definition
76+
```
77+
78+
Or you can configure individual documentation pages per webhook event:
79+
80+
```yaml title="docs.yml"
81+
navigation:
82+
- subpackage_api.newPlantWebhook # Format: subpackage_{name-of-api}.{webhook-event-name}
83+
```
84+
85+
For more information on how to configure your webhook reference in `docs.yml`, see [Generate your webhook reference](/docs/api-references/generate-webhook-reference).
86+

fern/products/api-def/openapi-pages/auth.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ components:
164164
prefix: "Token " # Optional
165165
```
166166

167+
<Info>
168+
The `prefix` option lets you automatically add a prefix to API keys. This is useful when your API expects tokens in a specific format like `"Bearer abc123"` or `"Token abc123"`.
169+
</Info>
170+
167171
The generated SDK would look like:
168172

169173
```ts index.ts

fern/products/api-def/openapi-pages/extensions/overview.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ The table below shows all available extensions and links to detailed documentati
1414
| --- | --- |
1515
| [`x-fern-version`](./api-version) | Configure API version schemes and headers |
1616
| [`x-fern-audiences`](./audiences) | Filter endpoints, schemas, and properties by audience |
17+
| [`x-fern-basic`](/api-definitions/openapi/authentication#basic-security-scheme) | Customize basic authentication parameter names and environment variables |
18+
| [`x-fern-bearer`](/api-definitions/openapi/authentication#bearer-security-scheme) | Customize bearer authentication parameter names and environment variables |
1719
| [`x-fern-availability`](./availability) | Mark availability status (beta, generally-available, deprecated) |
1820
| [`x-fern-base-path`](./base-path) | Set base path prepended to all endpoints |
1921
| [`x-fern-enum`](./enum-descriptions-and-names) | Add descriptions and custom names to enum values |
2022
| [`x-fern-examples`](./request-response-examples) | Associate request and response examples |
2123
| [`x-fern-global-headers`](./global-headers) | Configure headers used across all endpoints |
24+
| [`x-fern-header`](/api-definitions/openapi/authentication#apikey-security-scheme) | Customize API key header authentication parameter names and environment variables |
2225
| [`x-fern-ignore`](./ignoring-elements) | Skip reading specific endpoints or schemas |
2326
| [`x-fern-sdk-method-name`](./method-names) | Customize SDK method names |
2427
| [`x-fern-sdk-group-name`](./method-names) | Organize methods into SDK groups |

fern/products/api-def/openapi-pages/overview.mdx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: What is an OpenAPI Specification?
33
description: OpenAPI is a standard for documenting REST APIs
44
---
55

6-
The OpenAPI Specification (OAS) is a framework used by developers to document REST APIs. The specification
6+
The OpenAPI Specification (OAS) is a framework used by developers to document REST APIs. The specification is
77
written in JSON or YAML and contains all of your endpoints, parameters, schemas, and authentication schemes.
88
Fern is compatible with the latest OAS release, which is currently [v3.1.1](https://spec.openapis.org/#openapi-specification).
99

1010
Below is an example of an OpenAPI file:
1111

12-
```yaml openapi.yml
12+
```yaml title="openapi.yml" maxLines=10
1313
openapi: 3.0.2
1414
info:
1515
title: Petstore - OpenAPI 3.0
@@ -101,8 +101,46 @@ components:
101101
name: api_key
102102
in: header
103103
```
104+
## Best practices
104105
105-
## Setup your fern folder
106+
Follow these best practices to ensure your OpenAPI specification generates high-quality SDKs and documentation:
107+
108+
- **Organize with proper project structure.** Follow the instructions at [Project structure](/api-definitions/overview/project-structure) to clearly organize the directories that contain your definition and other related files.
109+
- **Add `operationId` to endpoints.** Include a clear `operationId` for each endpoint to control the function names generated in your SDKs. (Or use [extensions to customize group and method names](/api-definitions/openapi/extensions/method-names).)
110+
- **Reference schemas instead of inlining.** Define reusable schemas in the `components/schemas` section and reference them with `$ref`. This promotes consistency, reduces duplication, and makes maintenance easier.
111+
<Accordion title="Example of referencing schemas">
112+
```yaml title="openapi.yml" {8, 14, 17-25}
113+
paths:
114+
/pets:
115+
post:
116+
requestBody:
117+
content:
118+
application/json:
119+
schema:
120+
$ref: '#/components/schemas/Pet' # Clean reference
121+
responses:
122+
'200':
123+
content:
124+
application/json:
125+
schema:
126+
$ref: '#/components/schemas/Pet' # Reused easily
127+
components:
128+
schemas:
129+
Pet: # Defined once, used everywhere
130+
type: object
131+
properties:
132+
name:
133+
type: string
134+
status:
135+
type: string
136+
enum: [available, pending, sold]
137+
```
138+
</Accordion>
139+
- **Use overrides and Fern extensions for customization.** Customize your specification using Fern [extensions](/api-definitions/openapi/extensions/overview) housed in an [overrides file](/api-definitions/overview/overrides). This lets you modify generation behavior without changing your core OpenAPI definition.
140+
141+
Once your OpenAPI spec follows these practices, you're ready to set up your fern folder.
142+
143+
## Set up your fern folder
106144

107145
<Info> Considering options to generate an OpenAPI spec? Get live support [here](https://fern-community.slack.com/join/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q%EF%BB%BF#/shared-invite/email) </Info>
108146

fern/products/api-def/openapi-pages/webhooks.mdx

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ Fern supports two methods for defining webhooks in your OpenAPI specification:
88
1. Using OpenAPI 3.1's native webhook support (recommended)
99
2. Using Fern's `x-fern-webhook` extension
1010

11-
## OpenAPI 3.1 Webhooks
11+
## OpenAPI 3.1 webhooks
1212

1313
For OpenAPI 3.1 specifications, use the `webhooks` top-level field to define your webhook operations. Each webhook requires an `operationId` to be properly processed by Fern.
1414

15-
To create dedicated pages in your API reference documentation for each webhook
16-
event, include `tags` and complete `example` data in your schema. Then, [add a
17-
reference in your
18-
`docs.yml`](/docs/api-references/generate-webhook-reference#create-individual-documentation-pages-for-each-webhook-event-openapi).
19-
2015
```yaml openapi.yml {4, 7-8, 42-48}
2116
webhooks:
2217
newPlant:
@@ -71,15 +66,10 @@ webhooks:
7166
description: Return a 200 status to indicate that the data was received successfully
7267
```
7368
74-
## Fern Webhook Extension
69+
## Fern webhook extension
7570
7671
For OpenAPI 3.0, use the `x-fern-webhook: true` extension to define webhooks. Fern will treat the `requestBody` as the webhook payload.
7772

78-
To create dedicated pages in your API reference documentation for each webhook
79-
event, include `tags` and complete `example` data in your schema. Then, [add a
80-
reference in your
81-
`docs.yml`](/docs/api-references/generate-webhook-reference#create-individual-documentation-pages-for-each-webhook-event-openapi).
82-
8373
```yaml openapi.yml {6-8, 23-25}
8474
paths:
8575
/payment/updated/:
@@ -112,3 +102,24 @@ paths:
112102
The path that you choose when defining a webhook can be arbitrary. Since webhooks
113103
can be sent to any server, Fern just ignores the path.
114104
</Info>
105+
106+
## Generate webhook reference
107+
108+
Fern Docs can automatically generate your webhook reference documentation from your definition. Set this up in your `docs.yml` file.
109+
110+
Your webhook reference can be a single documentation page:
111+
112+
```yml docs.yml
113+
navigation:
114+
- api: Webhook Reference # Display name for this page
115+
api-name: webhooks-v1 # Name of webhook definition directory
116+
```
117+
118+
Or you can configure individual documentation pages per webhook event:
119+
120+
```yaml title="docs.yml"
121+
navigation:
122+
- subpackage_plants.newPlantWebhook # subpackage_{tag}.{webhook-event-name}
123+
```
124+
125+
For more information on how to configure your webhook reference in `docs.yml`, see [Generate your webhook reference](/docs/api-references/generate-webhook-reference).

fern/products/ask-fern/pages/getting-started/how-it-works.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ The interface maintains your site's design language while providing a familiar c
2121

2222
The main parts of the Ask Fern system are:
2323

24-
* **Content indexing** – Fern automatically processes your documentation pages,
25-
breaking them into semantic chunks and converting each chunk into a vector
26-
using sentence embedding models. They're stored in a database that serves as
27-
Ask Fern's search index.
24+
* **Content and code indexing** – Fern automatically processes your
25+
documentation pages and Fern-generated SDK code, breaking them into semantic
26+
chunks and converting each chunk into a vector using sentence embedding
27+
models. They're stored in a database that serves as Ask Fern's search index.
2828
* **Query processing** – When users ask questions, Ask Fern vectorizes their
29-
query and searches the database to find the most relevant documentation
30-
chunks. If you have [role-based access control](/docs/authentication/rbac) configured, Ask Fern filters results based on the user's permissions.
29+
query and searches the database to find the most relevant documentation and
30+
code chunks. If you have [role-based access control](/docs/authentication/rbac) configured, Ask Fern filters results based on the user's permissions.
3131
* **Response generation** – Ask Fern uses the retrieved chunks as context to
3232
generate accurate answers with [citations](/ask-fern/features/citations) for the user. If the initial context isn't sufficient, it performs an additional keyword search.
3333

fern/products/ask-fern/pages/getting-started/what-is-ask-fern.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Ask Fern helps you:
4040

4141
<Card
4242
title="Citations"
43-
icon="regular quote-right"
43+
icon="fa-solid fa-quote-right"
4444
href="/learn/ask-fern/features/citations"
4545
>
4646
Point users to the exact source of the answer.

fern/products/cli-api-reference/cli-changelog/2025-09-03.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**`(feat):`** Auto generate examples for HTTP endpoint error responses.
66

77
## 0.69.2
8-
**`(fix):`** Add custom license name extraction for Java SDK generation. The CLI now reads the first line
8+
**`(fix):`** Add custom license name extraction for Java SDK generation. The CLI now reads the first line
99
from custom LICENSE files and passes it to generators via the _fernLicenseName field in customConfig.
1010

1111

0 commit comments

Comments
 (0)