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/pages/project-structure.mdx
+17-36Lines changed: 17 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,10 @@ groups:
87
87
github:
88
88
repository: company/user-api-typescript
89
89
```
90
+
<Info>
91
+
You can use this same pattern for API versioning. See [Versioned APIs](#versioned-apis) below.
92
+
</Info>
93
+
90
94
</Accordion>
91
95
<Accordion title="Combined SDKs from multiple APIs">
92
96
@@ -125,48 +129,29 @@ api:
125
129
openapi: payments-api/openapi.yml
126
130
```
127
131
</Accordion>
128
-
<Accordion title="Versioned APIs in the same SDK">
132
+
<Accordion title="Versioned APIs">
129
133
130
-
Use this approach when you need to support multiple API versions simultaneously in your SDK.
134
+
When supporting multiple API versions, you can publish them as separate packages or combine them into a single package with namespaces.
131
135
132
-
#### Option 1: Branch-based versioning
136
+
#### Option 1: Separate packages for each API version
133
137
134
-
Each API version is maintained as a separate spec that publishes to a different branch of a single SDK repository. This approach allows you to release updates for older API versions independently and manage each as a different major version of your SDK (v1.x.x, v2.x.x).
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.
135
139
136
140
```bash
137
141
fern/
138
142
├─ fern.config.json
139
143
└─ apis/
140
-
├─ v1/
141
-
│ ├─ generators.yml # Configures v1 SDK
142
-
│ └─ openapi.yml
143
-
└─ v2/
144
-
├─ generators.yml # Configures v2 SDK
145
-
└─ openapi.yml
144
+
├─ v1/
145
+
│ ├─ generators.yml # Configures v1 SDKs
146
+
│ └─ openapi.yml
147
+
└─ v2/
148
+
├─ generators.yml # Configures v2 SDKs
149
+
└─ openapi.yml
146
150
```
147
151
148
-
Each API version must have its own `generators.yml` file that targets a [specific branch](/sdks/reference/generators-yml#github):
0 commit comments