-
Notifications
You must be signed in to change notification settings - Fork 47
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 for #104, adding support for mounted apps #244
base: main
Are you sure you want to change the base?
Conversation
Interpolate request.script_name for openapi path_pattern to accomodate
…o fix/mounted-apps
Can you please add a functional test for this? |
Hi @zupo. I cleaned up the fix and updated the existing test for The PR checks above fail on |
I'll have a look. |
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.
A few minor suggestions.
else self.request.path_info | ||
) | ||
|
||
# since application might be mounted on virtual location we need |
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.
# since application might be mounted on virtual location we need | |
# Since application might be mounted on virtual location we need |
|
||
# since application might be mounted on virtual location we need | ||
# to prepend it to the route pattern, or request's response validation | ||
# will fail. one example of this is using WSGI compositors like |
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.
# will fail. one example of this is using WSGI compositors like | |
# will fail. One example of this is using WSGI compositors like |
path_pattern = "%s%s" % ( | ||
self.request.script_name, | ||
self.request.matched_route.pattern, | ||
) |
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.
path_pattern = "%s%s" % ( | |
self.request.script_name, | |
self.request.matched_route.pattern, | |
) | |
path_pattern = f"{self.request.script_name}{self.request.matched_route.pattern}" |
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.
This should also fix the pyupgrade warning.
Without realizing this PR was here I think I just reimplemented the same fix that @goodwillcoding had done in this PR over at #263. Mine is slightly different in that I didn't use |
No description provided.