Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "encodeParams" option to rtkq-codegen-openapi #4568

Merged
merged 6 commits into from
Aug 30, 2024

Conversation

bayasdev
Copy link
Contributor

@bayasdev bayasdev commented Aug 17, 2024

Overview

This PR introduces a new encodeParams option to the Redux Toolkit Query (RTKQ) OpenAPI code generator. When enabled, this option will automatically apply encodeURIComponent to the generated query parameters, ensuring that special characters in query strings are correctly encoded.

This feature will be useful for users who need to ensure their query parameters are URL safe, particularly in cases where special characters are commonly used.

Fixes #3822

This PR:

  • Adds encodeParams option to automatically perform URL safe encoding to the generated query and path parameters
  • Adds test cases for encodeParams option
  • Fixes flattenArg test case which was not passing due to formatting

Copy link

codesandbox bot commented Aug 17, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

codesandbox-ci bot commented Aug 17, 2024

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 a989ed9:

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

Copy link

netlify bot commented Aug 17, 2024

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

Name Link
🔨 Latest commit a989ed9
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/66d224aa5654c8000804c080
😎 Deploy Preview https://deploy-preview-4568--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.

@markerikson
Copy link
Collaborator

Seems reasonable, thanks!

@markerikson markerikson merged commit ac4d85e into reduxjs:master Aug 30, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to encode query arguments in openApi codegen
2 participants