Skip to content

Commit 0d8ad6d

Browse files
committed
fix wording
1 parent 000f61e commit 0d8ad6d

File tree

1 file changed

+17
-36
lines changed

1 file changed

+17
-36
lines changed

fern/products/api-def/pages/project-structure.mdx

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ groups:
8787
github:
8888
repository: company/user-api-typescript
8989
```
90+
<Info>
91+
You can use this same pattern for API versioning. See [Versioned APIs](#versioned-apis) below.
92+
</Info>
93+
9094
</Accordion>
9195
<Accordion title="Combined SDKs from multiple APIs">
9296
@@ -131,56 +135,33 @@ When supporting multiple API versions, you can publish them as separate packages
131135
132136
#### Option 1: Separate packages for each API version
133137
134-
Use this approach when you want each API version to be independently installable (e.g., `@company/sdk-v1`, `@company/sdk-v2`).
138+
Use this approach when you want each API version to be independently installable (e.g., `@company/sdk-v1`, `@company/sdk-v2`). This use case follows the [Separate SDKs for each API](#separate-sdks-for-each-api) pattern.
135139

136140
```bash
137-
# Each API version in its own directory
138-
v1-sdk/
139-
└─ fern/
140-
├─ fern.config.json
141-
├─ generators.yml
142-
└─ v1/
143-
└─ openapi.yml
144-
v2-sdk/
145-
└─ fern/
146-
├─ fern.config.json
147-
├─ generators.yml
148-
└─ v2/
149-
└─ openapi.yml
141+
fern/
142+
├─ fern.config.json
143+
└─ apis/
144+
├─ v1/
145+
│ ├─ generators.yml # Configures v1 SDKs
146+
│ └─ openapi.yml
147+
└─ v2/
148+
├─ generators.yml # Configures v2 SDKs
149+
└─ openapi.yml
150150
```
151151

152-
Each API version must have its own `generators.yml` file:
153-
154-
<Tabs>
155-
<Tab title="v1-sdk/fern/generators.yml">
152+
Each API must have its own `generators.yml` file:
156153

157-
```yaml title="v1-sdk/fern/generators.yml"
154+
```yaml title="apis/v1/generators.yml"
158155
api:
159156
specs:
160-
- openapi: v1/openapi.yml
157+
- openapi: openapi.yml
161158
groups:
162159
ts-sdk:
163160
generators:
164161
- name: fernapi/fern-typescript-sdk
165162
github:
166163
repository: company/sdk-v1
167164
```
168-
</Tab>
169-
<Tab title="v2-sdk/fern/generators.yml">
170-
171-
```yaml title="v2-sdk/fern/generators.yml"
172-
api:
173-
specs:
174-
- openapi: v2/openapi.yml
175-
groups:
176-
ts-sdk:
177-
generators:
178-
- name: fernapi/fern-typescript-sdk
179-
github:
180-
repository: company/sdk-v2
181-
```
182-
</Tab>
183-
</Tabs>
184165

185166
#### Option 2: Namespace-based versioning
186167

0 commit comments

Comments
 (0)