Open gimenete opened 1 year ago
Hey @gimenete, i've just published the new v1.0.0 release that fixes this issue, i'm now using the decodeURIComponent
in the url before parsing the parameters
Let me know if you are still having this issue
Migration guide to 1.0.0 available here
Hey @G4brym
I think this is still an issue for path params. I see that decodeURIComponent
is being used inside extractQueryParameters
but I guess that only affects query parameters and not path parameters, right?
@gimenete path parameters are parsed on itty-router, i've openned a pull request there is the required changes https://github.com/kwhitley/itty-router/pull/184
Thanks @G4brym - taking a look now!
Not really sure if it's a bug with
itty-router
oritty-router-openapi
but it affectsitty-router-openapi
users.Given an endpoint like this (using
.original
for simplicity):Making a query to
/something/user%3A1234
returns the following response:id: user%3A1234
. While it should beid: user:1234
.Just to make sure my assumption is correct I made an express application with a similar endpoint and the response is correct (
id: user:1234
):My workaround is to decode the full URL before passing it to the library. Like this:
Not sure if it's the best approach.