Skip to content

Support custom query params parsing logic, instead of URLSearchParams #4063

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

Open
dil-atanko opened this issue Apr 11, 2025 · 2 comments
Open
Labels
enhancement New feature or request.

Comments

@dil-atanko
Copy link

dil-atanko commented Apr 11, 2025

What is the feature you are proposing?

In a complex application we faced an issue when we tried to pass nested query parameters.
The library qs handles this very well.
It would be nice to be able to replace that logic on the hono/client and on the server side too.
For example: { page: '1', pageSize: '25', 'status[0]': 'DRAFT' } it is a parsed result from the server side from this query: page=1&pageSize=25&status%5B0%5D=DRAFT but qs is able to parse this correctly back to an array instead of this string key: status[0].

Server side: https://github.com/honojs/hono/blob/main/src/utils/url.ts#L210
Client side: https://github.com/honojs/hono/blob/main/src/client/utils.ts#L18

@dil-atanko dil-atanko added the enhancement New feature or request. label Apr 11, 2025
@yusukebe
Copy link
Member

Duplicated to #3667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

3 participants
@yusukebe @dil-atanko and others