Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Use this for config migrations and major generator or CLI upgrades.

1. Preview: `fern sdk migrate --dry-run`. Narrow it with `--group`, `--language` or `--api`. `--strict` treats mapping problems as errors.
2. Apply: `fern sdk migrate`. It creates or merges `sdk-config.yml` beside the legacy configuration (`--output` to choose the path).
3. Run `fern check` and `fern generate --preview`, and compare the output with the current SDK.
3. Fix each warning. Tests are opt-in (`generation.unitTests`, `generation.wireTests`). Keep a header or bearer option name with `x-fern-header` or `x-fern-bearer` in an overlay. Add `step` to offset `x-fern-pagination`. Move an `x-fern-base-path` into the server URLs.
4. Run `fern check` and `fern generate --preview`, and compare the output with the current SDK.

## Upgrade the CLI and generators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,20 @@ Don't copy a legacy generator version into `generatorVersion`. The CLI rejects v
`fern generate --version` sets the version of the generated SDK package, not the generator version.
</Note>

### Check behavior that changes

The new generators don't reproduce every legacy behavior. `fern sdk migrate` warns about the auth option names, API settings, and spec extensions in the table. Review the warnings, or run `fern sdk migrate --dry-run --strict` to fail on them, and fix each one before you generate:

| Legacy configuration | Behavior after migration | What to do |
|---|---|---|
| Tests generated by default | Tests and their CI workflow are opt-in | Set `generation.unitTests` or `generation.wireTests`. See [Testing](/learn/sdks/deep-dives/testing). |
| Header auth `name` or bearer `token.name` | The option is renamed to `apiKey` or `token` | Set `x-fern-header` or `x-fern-bearer` with `name` on the security scheme in an [overlay](/learn/api-definitions/openapi/overlays). |
| API settings with no SDK Config field, such as `filter`, `resolve-aliases` or `coerce-consts-to` | The setting is dropped. With `filter`, excluded endpoints are generated | Remove filtered endpoints with an overlay, and compare the output for the other settings. |
| `only-include-referenced-schemas`, `inline-all-of-schemas` | Copied to `sdk-config.yml`, but the generators don't apply them yet | Expect unreferenced and `allOf` parent types in the output. |
| `x-fern-base-path` | Requests omit the base path | Add the base path to the server or environment URLs. |
| `x-fern-sdk-variables` | Each variable is a parameter on every request, not a client option | Check the generated method signatures. |
| Offset [`x-fern-pagination`](/learn/api-definitions/openapi/extensions/pagination) without `step` | Python and Go return the raw page with no pager | Set `step` to the page size parameter, for example `step: $request.limit`. |

## Validate and preview

Validate the migrated project, then preview the migrated target:
Expand Down
Loading