|
8 | 8 | """
|
9 | 9 | import hashlib
|
10 | 10 |
|
11 |
| -from django.urls import re_path, path |
| 11 | +from django.urls import re_path, path, URLPattern |
12 | 12 | from drf_yasg import openapi
|
13 | 13 | from drf_yasg.views import get_schema_view
|
14 | 14 | from rest_framework import permissions
|
@@ -46,11 +46,15 @@ def init_chat_doc(application_urlpatterns, patterns):
|
46 | 46 | public=True,
|
47 | 47 | permission_classes=[permissions.AllowAny],
|
48 | 48 | authentication_classes=[AnonymousAuthentication],
|
49 |
| - patterns=[url for url in patterns if |
50 |
| - url.name is not None and ['application/message', 'application/open', |
51 |
| - 'application/profile'].__contains__( |
52 |
| - url.name)] |
| 49 | + patterns=[ |
| 50 | + URLPattern(pattern='api/' + str(url.pattern), callback=url.callback, default_args=url.default_args, |
| 51 | + name=url.name) |
| 52 | + for url in patterns if |
| 53 | + url.name is not None and ['application/message', 'application/open', |
| 54 | + 'application/profile'].__contains__( |
| 55 | + url.name)] |
53 | 56 | )
|
| 57 | + |
54 | 58 | application_urlpatterns += [
|
55 | 59 | path('doc/chat/', chat_schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
56 | 60 | path('redoc/chat/', chat_schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
|
0 commit comments