Skip to content
Snippets Groups Projects

GREG-25: Adding namespace versioning

Merged Tore.Brede requested to merge GREG-25_add_api_versioning into master
Files
6
+ 0
13
from django.urls import (
path,
re_path,
)
from rest_framework.routers import DefaultRouter
from drf_spectacular.views import (
SpectacularAPIView,
SpectacularSwaggerView,
)
from greg.api.views.consent import ConsentViewSet
from greg.api.views.organizational_unit import OrganizationalUnitViewSet
@@ -16,7 +11,6 @@ from greg.api.views.person import (
PersonIdentityViewSet,
)
from greg.api.views.role import RoleViewSet
from greg.api.views.health import Health
from greg.api.views.sponsor import SponsorViewSet, SponsorGuestsViewSet
router = DefaultRouter()
@@ -30,13 +24,6 @@ router.register(r"orgunit", OrganizationalUnitViewSet, basename="orgunit")
urlpatterns = router.urls
urlpatterns += [
path("schema/", SpectacularAPIView.as_view(), name="schema"),
path(
"schema/swagger-ui/",
SpectacularSwaggerView.as_view(url_name="schema"),
name="swagger-ui",
),
path("health/", Health.as_view()),
re_path(
r"^persons/(?P<person_id>[0-9]+)/roles/$",
PersonRoleViewSet.as_view({"get": "list", "post": "create"}),
Loading