github reduxjs/redux-toolkit @rtk-query/codegen-openapi@2.1.0

latest release: v2.9.1
5 days ago

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 underlying oazapfts library to use unknown as a fallback type instead of any (per oazapfts/oazapfts#676 )
  • esmExtensions: if enabled, import statements will use the appropriate compiled file extension explicitly (such as import { 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

Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/@rtk-query/codegen-openapi@2.0.0...@rtk-query/codegen-openapi@2.1.0

Don't miss a new redux-toolkit release

NewReleases is sending notifications on new releases.