-
Notifications
You must be signed in to change notification settings - Fork 81
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
fix: fix match logic for path template #834
Conversation
Codecov Report
@@ Coverage Diff @@
## master #834 +/- ##
===========================================
+ Coverage 59.68% 88.96% +29.28%
===========================================
Files 46 38 -8
Lines 7426 6344 -1082
Branches 107 508 +401
===========================================
+ Hits 4432 5644 +1212
+ Misses 2994 697 -2297
- Partials 0 3 +3
Continue to review full report at Codecov.
|
src/pathTemplate.ts
Outdated
@@ -35,6 +35,8 @@ export class PathTemplate { | |||
constructor(data: string) { | |||
this.data = data; | |||
this.segments = this.parsePathTemplate(data); | |||
console.warn('this.bindings: ', this.bindings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the logging output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after logging is removed, thank you!
failing case: match
projects/{project=*}
withproject: long-project-name
from dialogflow sample-testgoogleapis/nodejs-dialogflow#617
the original logic is to check the matching string (
long-project-name
) if it can be divided by-_.~
, to decide whether it's non-slash resource (for example match{user_a}-{user_b}
withusera-userb
). but it will fail for the above case.Now we check the segments
{project=*}
if it has multiple brackets, it will be taken as non-slash resource (for example{user_a}-{user_b}