-
-
Notifications
You must be signed in to change notification settings - Fork 134
Support basic re_path #337
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
=======================================
Coverage 95.82% 95.82%
=======================================
Files 79 79
Lines 1627 1627
=======================================
Hits 1559 1559
Misses 68 68
Continue to review full report at Codecov.
|
@@ -36,6 +36,11 @@ def create(cls, request): | |||
else: | |||
route = cls.path_regex.sub( | |||
r'{\1}', request.resolver_match.route) | |||
# Delete start marker and expression marker to allow concatenation. | |||
if route[:1] == "^": | |||
route = route[1:] |
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.
I failed to trigger this case into a test environment as there are side effects in testing.
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.
@p1c2u Can you help me with it?
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.
Why not just add ^
to re_path:
re_path('^test/test-regexp/$', lambda d: None)
?
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.
I tried to add ^/
but it didn't work. Stupid mistake. It should work now.
@p1c2u It is green now. |
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
@mik-laj thanks for the contribution |
Helllo.
I had a project that used a very old URL format and unfortunately, this library couldn't find the path.
It turned out that this library tries to make various concatenations and matches based on this expression which obviously failed.
https://github.com/p1c2u/openapi-core/blob/512ff6b48d105351c4be730dd78c5d7c00492db1/openapi_core/templating/paths/finders.py#L49
Close: #278
Brest regards,
Kamil Breguła