This feature release adds new RTK Query codegen config options for useUnknown
and esmExtensions
, update the hook name generation to make use of operationNameSuffix
if available, fixes an issue with falsy query params, adds the CLI binary to the list of exports, and updates the swagger-parser
dep to give support for OpenAPI v3.0.4
Changelog
New Config Options
We've added two new config options:
useUnknown
: if enabled, tells the underlyingoazapfts
library to useunknown
as a fallback type instead ofany
(per oazapfts/oazapfts#676 )esmExtensions
: if enabled, import statements will use the appropriate compiled file extension explicitly (such asimport { api } from 'emptyApi.mjs'
)
Fixes
Fixed an issue where encodeQueryParams: true
would omit falsy values like 0 entirely, instead of encoding them as someValue=
.
Hook names now include the operationNameSuffix
if specified for that endpoint.
Other Updates
The package CLI is now properly listed in the package.json
exports.
The @apidevtools/swagger-parser
dependency was updated, which should enable support for OpenAPI v3.0.4 format files.
What's Changed
- feature: add cli to exports by @maddrag0n in #4977
- chore: update
@apidevtools/swagger-parser
to version 10.1.1 by @aryaemami59 in #4919 - Fix incorrect handling of query parameters with values 0 or empty str… by @yukiyokotani in #4782
- Add useUnknown config option to openapi codegen by @emersion in #4999
- fix: Generated hooks also includes
operationNameSuffix
when provided by @lcharlois-neotys in #5089 - Add RTKQ codegen config to toggle extensions of generated files by @TheMartianMaker in #4743
Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/@rtk-query/codegen-openapi@2.0.0...@rtk-query/codegen-openapi@2.1.0