diff --git a/rest_framework_docs/api_endpoint.py b/rest_framework_docs/api_endpoint.py index c691850..be88d31 100644 --- a/rest_framework_docs/api_endpoint.py +++ b/rest_framework_docs/api_endpoint.py @@ -23,7 +23,7 @@ def __init__(self, pattern, parent_regex=None, drf_router=None): self.callback = pattern.callback # self.name = pattern.name self.docstring = self.__get_docstring__() - self.name_parent = simplify_regex(parent_regex).strip('/') if parent_regex else None + self.name_parent = simplify_regex(parent_regex).strip('/').replace('\\', '') if parent_regex else None self.path = self.__get_path__(parent_regex) self.allowed_methods = self.__get_allowed_methods__() # self.view_name = pattern.callback.__name__ @@ -39,7 +39,7 @@ def __init__(self, pattern, parent_regex=None, drf_router=None): def __get_path__(self, parent_regex): regex = get_regex_pattern(self.pattern) if parent_regex: - return "/{0}{1}".format(self.name_parent, simplify_regex(regex)) + return "/{0}{1}".format(self.name_parent, simplify_regex(regex).replace('\\', '')) return simplify_regex(regex) def is_method_allowed(self, callback_cls, method_name):