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

ParamsSerializerOptions contains type definitions that are unnecessary from an implementation standpoint. #5771

Open
ShebangDog opened this issue Jul 11, 2023 · 1 comment
Labels
priority::medium A medium priority

Comments

@ShebangDog
Copy link

ShebangDog commented Jul 11, 2023

Describe the bug

ParamsSerializerOptions contains type definitions that are unnecessary from an implementation standpoint.

https://github.com/DigitalBrainJS/axios/blob/92f0758429541b05c614dc25bc712379d8a41dbd/lib/helpers/buildURL.js#L51-L57

Under the current situation where documentation is not well maintained, mistakes and misunderstandings can occur with the following argument types.
Check the following examples.

axios.create({
  paramsSerializer: {
    encode: value => value
    serialize: value => value // Value not referenced at runtime
  }
})

So we should remove the pattern of receiving both functions by modifying the type.
Or you should update the documentation.

PR: #5770

To Reproduce

No response

Code snippet

No response

Expected behavior

No response

Axios Version

No response

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

No response

OS

No response

Additional Library Versions

No response

Additional context/Screenshots

No response

@ShivamJha2436
Copy link

Okay, I can fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority::medium A medium priority
Projects
None yet
Development

No branches or pull requests

4 participants