-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Handle Swagger slash basepath within Swagger UI Middleware #1835
base: main
Are you sure you want to change the base?
Conversation
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 @nielsbox! The fix looks good, but some comments on the tests.
@@ -269,7 +269,7 @@ def base_path(self): | |||
|
|||
@base_path.setter | |||
def base_path(self, base_path): | |||
base_path = canonical_base_path(base_path) |
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 function seems to be fairly specific for this usecase, can we adjust it instead or create a different util
function that adjust the behaviour of canonical_base_path
in this way?
Then it's also easier to test because we can just write a unit test for that util function
@@ -269,7 +269,7 @@ def base_path(self): | |||
|
|||
@base_path.setter | |||
def base_path(self, base_path): | |||
base_path = canonical_base_path(base_path) |
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 bit wider comment: the property
itself still uses the canonical_base_path
function, so the "getter" returns a different value, there's also the added complexity that the base path is used as Flask blueprint name, which has its own rules
Fixes #1834 .
Changes proposed in this pull request: