Skip to content

Commit 3467ed7

Browse files
committed
clarify info on fern definition section display name
1 parent 2e61d95 commit 3467ed7

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed

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

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Each service defines:
2727
To define a service with an empty base path use the empty string: `base-path: ""`
2828
</Info>
2929

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+
3034
## Endpoints
3135

3236
An endpoint includes:
@@ -41,7 +45,7 @@ An endpoint includes:
4145
- **Successful (200) response** information _(Optional)_
4246
- **Error (non-200) responses** that this endpoint might return _(Optional)_
4347

44-
## URL path
48+
### URL path
4549

4650
Each endpoint has a URL path.
4751

@@ -63,7 +67,7 @@ The full path for the endpoint is the concatenation of:
6367
- The service `base-path`
6468
- The endpoint `path`
6569

66-
## Display name
70+
### Endpoint display name
6771

6872
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**.
6973

@@ -82,7 +86,7 @@ service:
8286
```
8387
</CodeBlock>
8488

85-
## Path parameters
89+
### Path parameters
8690

8791
Supply path parameters for your endpoints to create dynamic URLs.
8892

@@ -114,7 +118,7 @@ Services can also have path-parameters:
114118
```
115119
</CodeBlock>
116120

117-
## Query parameters
121+
### Query parameters
118122

119123
Each endpoint can specify query parameters:
120124

@@ -135,7 +139,7 @@ service:
135139
```
136140
</CodeBlock>
137141

138-
### `allow-multiple`
142+
#### `allow-multiple`
139143

140144
Use `allow-multiple` to specify that a query parameter is allowed
141145
multiple times in the URL, as in `?filter=jane&filter=smith`. This will alter
@@ -152,7 +156,7 @@ parameter.
152156
```
153157
</CodeBlock>
154158

155-
## Auth
159+
### Auth
156160

157161
Each endpoint can override the auth behavior specified in the service.
158162

@@ -171,7 +175,7 @@ Each endpoint can override the auth behavior specified in the service.
171175
```
172176
</CodeBlock>
173177

174-
## Headers
178+
### Headers
175179

176180
Each endpoint can specify request headers:
177181

@@ -213,7 +217,7 @@ Services can also specify request headers. These headers will cascade to the ser
213217
```
214218
</CodeBlock>
215219

216-
## Request body
220+
### Request body
217221

218222
Endpoints can specify a request body type.
219223

@@ -232,7 +236,7 @@ service:
232236
```
233237
</CodeBlock>
234238

235-
### Inlining a request body
239+
#### Inlining a request body
236240

237241
If the request body is an object, you can **inline the type declaration**. This
238242
makes the generated SDKs a bit more idiomatic.
@@ -255,7 +259,7 @@ makes the generated SDKs a bit more idiomatic.
255259
```
256260
</CodeBlock>
257261

258-
## Success response
262+
### Success response
259263

260264
Endpoints can specify a `response`, which is the type of the body that will be
261265
returned on a successful (200) call.
@@ -279,7 +283,7 @@ types:
279283
```
280284
</CodeBlock>
281285

282-
## Response status codes
286+
### Response status codes
283287

284288
You can also use the `status-code` field to specify a custom status code
285289
for a success response.
@@ -306,7 +310,7 @@ types:
306310
```
307311
</CodeBlock>
308312

309-
## Error responses
313+
### Error responses
310314

311315
Endpoints can specify error responses, which detail the non-200 responses that
312316
the endpoint might return.
@@ -453,7 +457,7 @@ the request body, path parameters, query parameters, headers, and response body.
453457
```
454458
</CodeBlock>
455459
456-
### Failed examples
460+
#### Failed examples
457461
458462
You can also specify examples of failed endpoints calls. Add the `error`
459463
property to a response example to designate which failure you're demonstrating.
@@ -490,7 +494,7 @@ errors:
490494
```
491495
</CodeBlock>
492496
493-
### Referencing examples from types
497+
#### Referencing examples from types
494498
495499
To avoid duplication, you can reference examples from types using `$`.
496500

fern/products/docs/pages/api-references/customize-api-ref.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,28 @@ To reference an endpoint, you can use either:
9898

9999
### Renaming sections
100100

101-
To override the display name of a section (created from tags in your API spec),
102-
you can use the `section` property in your `docs.yml` and reference the original
103-
tag name using `referenced-packages`.
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`.
104105

105106
```yaml title="docs.yml" {4-6}
106107
navigation:
107108
- api: API Reference
108109
layout:
109-
- section: "User" # New display name
110+
- section: "Billing" # New section display name
110111
referenced-packages:
111-
- user-endpoint # Original tag name from your spec
112+
- billing # lowerCamelCase version of original tag/service file name from your spec
112113
contents: []
113-
- section: "Plant"
114+
- section: "Bank Accounts"
114115
referenced-packages:
115-
- plant
116+
- bankAccounts
116117
contents: []
117118
```
118119
<Note>
119-
You can alternatively customize tag display names directly in your spec (or `overrides.yml` file) using the [`x-displayName` extension (OpenAPI)](/api-definitions/openapi/extensions/tag-display-names) or the [`display-name` parameter (Fern Definition)](/api-definitions/ferndef/endpoints/overview#display-name)
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).
120121
</Note>
121122

122-
123123
### Flattening sections
124124
To remove the API Reference title and display the section contents, set `flattened` to `true`.
125125

0 commit comments

Comments
 (0)