django-rest-swagger
django-rest-swagger copied to clipboard
django 2.0 re_path not correct
re_path(r'^test/([^-][\w-]+)/(\d+)/anything', views.SomeView.as_view())
should match 'test/blalbalaba/6668888/foobar/'
but the swagger ui display the wrong url GET /test/{var}/test/(:[-][\w-]+)/{var}/anything
this is specific to 2.1.2 I guess :) It works in 2.2.0 But 2.2.0 has other issues (which is why I downgraded too)
We have a similar problem:
COURSE_KEY_PATTERN = r'(?P<course_key_string>[^/+]+(/|\+)[^/+]+(/|\+)[^/?]+)'
...
urlpatterns = [
url(r'^v1/courses/{}'.format(settings.COURSE_KEY_PATTERN), CourseDetailView.as_view(), name="course-detail"),
]
Produces this in the doc:
/api/courses/v1/courses/(P{course_key_string}[/+]+{var}[/+]+api/courses/v1/courses/(P{course_key_string}[/+]+(/|\+)[/+]+{var}[/]+)
This is with 2.2.0.