redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

feat: extend endpoint overrides for openapi codegen

Open sebws opened this issue 1 year ago • 5 comments

Add an option to filter parameters into endpoint overrides for RTK Query codegen for OpenApi schemas.

Both the path parameter and the body parameter aren't included in this, but could possibly be if it is thought that that would be helpful. I wasn't sure they would need to be filtered since they're less likely than other locations to be auto-added by a middleware.

This means it can filter out from the query, header, or cookie as seen in "Parameter Locations" in the OpenAPI spec

It only runs on the first (by order of endpointOverrides array) filter. This was the existing behaviour for query type, and makes enough sense.

Inspired by my issue https://github.com/reduxjs/redux-toolkit/issues/4285 and another relevant issue https://github.com/reduxjs/redux-toolkit/issues/3006

sebws avatar Mar 26 '24 13:03 sebws

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

codesandbox[bot] avatar Mar 26 '24 13:03 codesandbox[bot]

Deploy Preview for redux-starter-kit-docs ready!

Name Link
Latest commit fdb9e20d6a1da6613c8a1c7b34f86af31ee096f8
Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/6602c8a35bacb00008bc4e2c
Deploy Preview https://deploy-preview-4305--redux-starter-kit-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 26 '24 13:03 netlify[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3585e82b693159ad23f74473ade365e83c052f88:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

codesandbox-ci[bot] avatar Mar 26 '24 13:03 codesandbox-ci[bot]

Deploy Preview for redux-starter-kit-docs ready!

Name Link
Latest commit 3585e82b693159ad23f74473ade365e83c052f88
Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/66d237683895230008822805
Deploy Preview https://deploy-preview-4305--redux-starter-kit-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 26 '24 13:03 netlify[bot]

hi there, any chance someone could take a look at this?

sebws avatar Jun 13 '24 05:06 sebws

Should be live in https://github.com/reduxjs/redux-toolkit/releases/tag/%40rtk-query%2Fcodegen-openapi%402.0.0-alpha.0 ! Please try it out and let us know if it works.

markerikson avatar Aug 30 '24 23:08 markerikson