@hey-api/openapi-ts 0.27.37 → 0.27.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +1 -1
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- [Linting](#linting)
|
|
14
14
|
- [Enums](#enums)
|
|
15
15
|
- [Config API](#config-api)
|
|
16
|
+
- [Migrating](#migrating)
|
|
16
17
|
- [Contributing](#contributing)
|
|
17
18
|
|
|
18
19
|
## About
|
|
@@ -160,7 +161,7 @@ $ openapi-ts --help
|
|
|
160
161
|
-o, --output <value> Output directory (required)
|
|
161
162
|
-c, --client <value> HTTP client to generate [fetch, xhr, node, axios, angular] (default: "fetch")
|
|
162
163
|
--name <value> Custom client class name
|
|
163
|
-
--useOptions <value> Use options instead of arguments (default:
|
|
164
|
+
--useOptions <value> Use options instead of arguments (default: true)
|
|
164
165
|
--base <value> Manually set base in OpenAPI config instead of inferring from server value
|
|
165
166
|
--enums Generate JavaScript objects from enum definitions (default: false)
|
|
166
167
|
--exportCore <value> Write core files to disk (default: true)
|
|
@@ -179,6 +180,24 @@ $ openapi-ts --help
|
|
|
179
180
|
-h, --help display help for command
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
## Migrating
|
|
184
|
+
|
|
185
|
+
While we try to avoid breaking changes, sometimes it's unavoidable in order to offer you the latest features.
|
|
186
|
+
|
|
187
|
+
### v0.27.38
|
|
188
|
+
|
|
189
|
+
### `useOptions: true`
|
|
190
|
+
|
|
191
|
+
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.
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import { DefaultService } from 'client' // <-- old client with array arguments
|
|
195
|
+
|
|
196
|
+
import { DefaultService } from 'client_v2' // <-- new client with options argument
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
This 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`.
|
|
200
|
+
|
|
182
201
|
## Contributing
|
|
183
202
|
|
|
184
203
|
Please refer to the [contributing guide](CONTRIBUTING.md) for how to install the project for development purposes.
|