Closed ifozest closed 1 month ago
Technically this is a correctness problem, isn't it? Anything going into an URI path should be encoded as an URI component, period.
I faced the same issue. Used encodeURIComponent
in the same way to overcome it.
I'm facing this issue only in Safari and Firefox and it's working fine in Chromium browsers as they seem auto encode URLs before requesting them.
I was just bit by this issue in Chrome and absolutley agree this should be handled in the API Client library... Is there any fix available?
Or would RTK team accept a PR to add this?
I'm facing the same issue, would a fix be available soon?
Edit: nvm sent a PR
Hi all,
Currently, there is no way to specify that query arguments should be encoded when generating OpenAPI code using rtk query codegen. This can be a problem if you are using an argument with special characters, such as #.
For example, the following query function would result in an OpenAPI endpoint:
To fix this, I would like to request an option to enable query argument encoding in OpenAPI codegen. This would generate the following query function and generate an encoded endpoint:
/api/${encodeURIComponent(queryArg.foo)}
or similarI believe that this would be a valuable addition to rtk query openAPI codegen, as it would make it easier to use query args with special characters.
Thank you for your consideration.
Meantime I'm using
injectEndpoints
and overwriting them which is not ideal.