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
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,59 +125,59 @@ api:
125
125
openapi: payments-api/openapi.yml
126
126
```
127
127
</Accordion>
128
-
<Accordion title="Versioned APIs in the same SDK">
128
+
<Accordion title="Versioned APIs">
129
129
130
-
Use this approach when you need to support multiple API versions simultaneously in your SDK.
130
+
When supporting multiple API versions, you can publish them as separate packages or combine them into a single package with namespaces.
131
131
132
-
#### Option 1: Branch-based versioning
132
+
#### Option 1: Separate packages for each API version
133
133
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).
134
+
Use this approach when you want each API version to be independently installable (e.g., `@company/sdk-v1`, `@company/sdk-v2`).
135
135
136
136
```bash
137
-
fern/
138
-
├─ fern.config.json
139
-
└─ apis/
140
-
├─ v1/
141
-
│ ├─ generators.yml # Configures v1 SDK
142
-
│ └─ openapi.yml
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
143
148
└─ v2/
144
-
├─ generators.yml # Configures v2 SDK
145
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):
152
+
Each API version must have its own `generators.yml` file:
0 commit comments