You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/api-def/ferndef-pages/endpoints.mdx
+18-14Lines changed: 18 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,10 @@ Each service defines:
27
27
To define a service with an empty base path use the empty string: `base-path: ""`
28
28
</Info>
29
29
30
+
### Section display name
31
+
32
+
By default, section names in your API Reference come from service file names (e.g., `user.yml` becomes "User"). To override the display name of a section, [use the `section` property in your `docs.yml`](/docs/api-references/customize-api-reference-layout#renaming-sections).
33
+
30
34
## Endpoints
31
35
32
36
An endpoint includes:
@@ -41,7 +45,7 @@ An endpoint includes:
41
45
- **Successful (200) response** information _(Optional)_
42
46
- **Error (non-200) responses** that this endpoint might return _(Optional)_
43
47
44
-
## URL path
48
+
### URL path
45
49
46
50
Each endpoint has a URL path.
47
51
@@ -63,7 +67,7 @@ The full path for the endpoint is the concatenation of:
63
67
- The service `base-path`
64
68
- The endpoint `path`
65
69
66
-
## Display name
70
+
### Endpoint display name
67
71
68
72
The display name will appear as the title of an endpoint. By default, the display name is equal to the 'Title Case' of the endpoint name. If you would like to customize the endpoint name, you can **set the display name**.
69
73
@@ -82,7 +86,7 @@ service:
82
86
```
83
87
</CodeBlock>
84
88
85
-
## Path parameters
89
+
### Path parameters
86
90
87
91
Supply path parameters for your endpoints to create dynamic URLs.
88
92
@@ -114,7 +118,7 @@ Services can also have path-parameters:
114
118
```
115
119
</CodeBlock>
116
120
117
-
## Query parameters
121
+
### Query parameters
118
122
119
123
Each endpoint can specify query parameters:
120
124
@@ -135,7 +139,7 @@ service:
135
139
```
136
140
</CodeBlock>
137
141
138
-
### `allow-multiple`
142
+
#### `allow-multiple`
139
143
140
144
Use `allow-multiple` to specify that a query parameter is allowed
141
145
multiple times in the URL, as in `?filter=jane&filter=smith`. This will alter
@@ -152,7 +156,7 @@ parameter.
152
156
```
153
157
</CodeBlock>
154
158
155
-
## Auth
159
+
### Auth
156
160
157
161
Each endpoint can override the auth behavior specified in the service.
158
162
@@ -171,7 +175,7 @@ Each endpoint can override the auth behavior specified in the service.
171
175
```
172
176
</CodeBlock>
173
177
174
-
## Headers
178
+
### Headers
175
179
176
180
Each endpoint can specify request headers:
177
181
@@ -213,7 +217,7 @@ Services can also specify request headers. These headers will cascade to the ser
213
217
```
214
218
</CodeBlock>
215
219
216
-
## Request body
220
+
### Request body
217
221
218
222
Endpoints can specify a request body type.
219
223
@@ -232,7 +236,7 @@ service:
232
236
```
233
237
</CodeBlock>
234
238
235
-
### Inlining a request body
239
+
#### Inlining a request body
236
240
237
241
If the request body is an object, you can **inline the type declaration**. This
238
242
makes the generated SDKs a bit more idiomatic.
@@ -255,7 +259,7 @@ makes the generated SDKs a bit more idiomatic.
255
259
```
256
260
</CodeBlock>
257
261
258
-
## Success response
262
+
### Success response
259
263
260
264
Endpoints can specify a `response`, which is the type of the body that will be
261
265
returned on a successful (200) call.
@@ -279,7 +283,7 @@ types:
279
283
```
280
284
</CodeBlock>
281
285
282
-
## Response status codes
286
+
### Response status codes
283
287
284
288
You can also use the `status-code` field to specify a custom status code
285
289
for a success response.
@@ -306,7 +310,7 @@ types:
306
310
```
307
311
</CodeBlock>
308
312
309
-
## Error responses
313
+
### Error responses
310
314
311
315
Endpoints can specify error responses, which detail the non-200 responses that
312
316
the endpoint might return.
@@ -453,7 +457,7 @@ the request body, path parameters, query parameters, headers, and response body.
453
457
```
454
458
</CodeBlock>
455
459
456
-
### Failed examples
460
+
#### Failed examples
457
461
458
462
You can also specify examples of failed endpoints calls. Add the `error`
459
463
property to a response example to designate which failure you're demonstrating.
@@ -490,7 +494,7 @@ errors:
490
494
```
491
495
</CodeBlock>
492
496
493
-
### Referencing examples from types
497
+
#### Referencing examples from types
494
498
495
499
To avoid duplication, you can reference examples from types using `$`.
description: Customize how tag names appear in your API Reference using the `x-displayName` extension
4
+
---
5
+
6
+
By default, tag names from your OpenAPI specification become section names in your API Reference. Use the `x-displayName` extension to control how these section names display in your generated documentation. This is helpful for controlling capitalization and creating user-friendly names.
7
+
8
+
You can set display names directly in your spec or in an overrides file.
9
+
10
+
```yaml title="openapi.yml"
11
+
tags:
12
+
- name: task
13
+
x-displayName: Tasks
14
+
- name: billing-and-payments
15
+
x-displayName: Billing and Payments
16
+
```
17
+
18
+
<Note>
19
+
Alternatively, you can rename sections directly in your [`docs.yml` file](/docs/api-references/customize-api-reference-layout).
Copy file name to clipboardExpand all lines: fern/products/docs/pages/api-references/customize-api-ref.mdx
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,30 @@ To reference an endpoint, you can use either:
96
96
97
97
## Customizing the API Reference
98
98
99
+
### Renaming sections
100
+
101
+
By default, section display names come from [service file names](/api-definition/fern/endpoints#service-definition) (Fern
102
+
Definition) or tag names (OpenAPI) in your spec.
103
+
104
+
To override the display name of a section, use the `section` property in your `docs.yml` and reference the `lowerCamelCase` version of the original service file name (Fern Definition) or tag name (OpenAPI) in `referenced-packages`.
105
+
106
+
```yaml title="docs.yml" {4-6}
107
+
navigation:
108
+
- api: API Reference
109
+
layout:
110
+
- section: "Billing" # New section display name
111
+
referenced-packages:
112
+
- billing # lowerCamelCase version of original tag/service file name from your spec
113
+
contents: []
114
+
- section: "Bank Accounts"
115
+
referenced-packages:
116
+
- bankAccounts
117
+
contents: []
118
+
```
119
+
<Note>
120
+
For OpenAPI, you can alternatively customize tag display names directly in your spec (or `overrides.yml` file) using the [`x-displayName` extension](/api-definitions/openapi/extensions/tag-display-names).
121
+
</Note>
122
+
99
123
### Flattening sections
100
124
To remove the API Reference title and display the section contents, set `flattened` to `true`.
0 commit comments