diff --git a/greg/api/urls.py b/greg/api/urls.py index a2c98d41ba310ce9dbba1f4672a56d103206fc37..efb04f669b5fa86936651ac19413395a8efa7b21 100644 --- a/greg/api/urls.py +++ b/greg/api/urls.py @@ -23,34 +23,33 @@ router.register(r"orgunit", OrganizationalUnitViewSet, basename="orgunit") urlpatterns = router.urls -# Allowing trailing slashes to be optional for the URLs below urlpatterns += [ re_path( - r"^persons/(?P<person_id>[0-9]+)/roles/?$", + r"^persons/(?P<person_id>[0-9]+)/roles$", RoleViewSet.as_view({"get": "list", "post": "create"}), name="person_role-list", ), re_path( - r"^persons/(?P<person_id>[0-9]+)/roles/(?P<id>[0-9]+)/?$", + r"^persons/(?P<person_id>[0-9]+)/roles/(?P<id>[0-9]+)$", RoleViewSet.as_view( {"get": "retrieve", "patch": "partial_update", "delete": "destroy"} ), name="person_role-detail", ), re_path( - r"^persons/(?P<person_id>[0-9]+)/identities/?$", + r"^persons/(?P<person_id>[0-9]+)/identities$", IdentityViewSet.as_view({"get": "list", "post": "create"}), name="person_identity-list", ), re_path( - r"^persons/(?P<person_id>[0-9]+)/identities/(?P<id>[0-9]+)/?$", + r"^persons/(?P<person_id>[0-9]+)/identities/(?P<id>[0-9]+)$", IdentityViewSet.as_view( {"get": "retrieve", "delete": "destroy", "patch": "partial_update"} ), name="person_identity-detail", ), re_path( - r"^sponsors/(?P<sponsor_id>[0-9]+)/guests/?$", + r"^sponsors/(?P<sponsor_id>[0-9]+)/guests$", SponsorGuestsViewSet.as_view({"get": "list"}), name="sponsor_guests-list", ), diff --git a/greg/urls.py b/greg/urls.py index 9325046cfaee52fde52bca9bc54cfc2b8591d00d..8b9ac5e2390872fc991878b1e8e1d1c93526562f 100644 --- a/greg/urls.py +++ b/greg/urls.py @@ -24,12 +24,12 @@ from greg.api.views.health import Health urlpatterns: List[URLResolver] = [ path( - "schema/", + "schema", SpectacularAPIView.as_view(versioning_class=NamespaceVersioning), name="schema", ), # type: ignore path( - "schema/swagger-ui/", + "schema/swagger-ui", SpectacularSwaggerView.as_view( url_name="schema", versioning_class=NamespaceVersioning ), # type: ignore