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

feature request : add exclude specific keys to options array #499

Open
mojtabamaslahatbin opened this issue Mar 27, 2024 · 3 comments
Open

Comments

@mojtabamaslahatbin
Copy link

mojtabamaslahatbin commented Mar 27, 2024

in this function stringify(object, [options]);

when we have a key in object that we don't want to serialize it , we need to exclude it in options . for example:
i need this :

  &orderBy= {"property":"Amount","direction":"desc"}

but after serializing params object , result is like this :

&orderBy[property]=Amount&orderBy[direction]=asc
@ljharb
Copy link
Owner

ljharb commented Mar 27, 2024

I’m not sure what you mean. You have an API that accepts JSON a in a query string? That seems bizarre to me.

@mojtabamaslahatbin
Copy link
Author

yes unfortunately in this wiered case it accepts JSON a in a query string😄.
but In general, the possibility of excluding a part of the data can be used for different use cases.

@ljharb
Copy link
Owner

ljharb commented Mar 27, 2024

Seems like you should already be able to do this with a custom encoder.

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

No branches or pull requests

2 participants