Migrating ​
While we try to avoid breaking changes, sometimes it's unavoidable in order to offer you the latest features.
v0.27.38 ​
useOptions: true ​
By default, generated clients will use a single object argument to pass values to API calls. This is a significant change from the previous default of unspecified array of arguments. If migrating your application in one go isn't feasible, we recommend deprecating your old client and generating a new client.
import { DefaultService } from 'client' // <-- old client with array arguments
import { DefaultService } from 'client_v2' // <-- new client with options argumentThis way, you can gradually switch over to the new syntax as you update parts of your code. Once you've removed all instances of client imports, you can safely delete the old client folder and find and replace all client_v2 calls to client.
OpenAPI TypeScript Codegen ​
openapi-ts was originally forked from Ferdi Koomen's openapi-typescript-codegen. At first, we only added support for OpenAPI v3.1, but we've changed more things since. As of v0.34.5, our APIs are similar, so migrating should be relatively straightforward. If you run into an issue with migration, please open an issue.
Changes ​
- exportSchemasis- trueby default (set- exportSchemasto- falseto preserve the old behavior, in v0.36.0 this has been renamed to- schemas)
- clientis optional (old behavior preserved, but can be most likely removed)
Removed ​
- useUnionTypeshas been removed (- openapi-tsworks the same as- useUnionTypes: truebefore)
- indenthas been removed (use code formatter to style output)
- postfixModelshas been removed (open an issue if you have a critical use case)
Deprecated ​
- useOptions: falseis deprecated and- trueby default (see v0.27.38)
- postfixServicesis deprecated and will be removed in future releases
- requestwill be deprecated and removed in future releases
- namewill be deprecated and removed in future releases
