You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual Path Keys and Values: `{ "id": "", "*": "4765_payID/status" }
I am sure there are other ways to register the same route like /payments/{id: [0-9]{4}}{local_wildcard}/* to handle the above cases but this doesn't allow /payments/1234_payID work around is to define two routes in that case. We are facing this issue as we are migrating from another router ( lua based ) to Chi and we want to keep the routes backward compatible. Does it make sense to support this usecase ? If so then i can take a initial look at this and raise a PR for the same.
Issue 2: Extension to the Issue 1, Wildcard endpoint is ignored
Endpoint 1 : /payments/{id: [0-9]{4}}*
Endpoint 2: /payments/{id: [0-9]{4}}/status
Request Path: /payments/4765_payID/not_status
Expected Status Code : 200 ( Path Matched )
Actual Status Code: 404 ( No route matched )
When there are multiple childs along with wildcard, it follows the path without wildcard in this case. I was thinking why not add * also in the sort function here to push the wildcards to the last ( tried locally, works fine). Please share your thoughts, i can raise the PR for the same
The text was updated successfully, but these errors were encountered:
Combining two related issues here. Please let me know if that is not fine, will create separate issues.
Issue 1: Path values are not correct
Endpoint:
/payments/{id: [0-9]{4}}*
Request Path:
/payments/4765_payID/status
Expected Path Keys and Values:
{ "id" : "4765", "*" : "_payID/status" }
Actual Path Keys and Values: `{ "id": "", "*": "4765_payID/status" }
I am sure there are other ways to register the same route like
/payments/{id: [0-9]{4}}{local_wildcard}/*
to handle the above cases but this doesn't allow/payments/1234_payID
work around is to define two routes in that case. We are facing this issue as we are migrating from another router ( lua based ) to Chi and we want to keep the routes backward compatible. Does it make sense to support this usecase ? If so then i can take a initial look at this and raise a PR for the same.Issue 2: Extension to the Issue 1, Wildcard endpoint is ignored
/payments/{id: [0-9]{4}}*
/payments/{id: [0-9]{4}}/status
Request Path:
/payments/4765_payID/not_status
Expected Status Code :
200
( Path Matched )Actual Status Code:
404
( No route matched )When there are multiple childs along with wildcard, it follows the path without wildcard in this case. I was thinking why not add
*
also in the sort function here to push the wildcards to the last ( tried locally, works fine). Please share your thoughts, i can raise the PR for the sameThe text was updated successfully, but these errors were encountered: