This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/authentik/api/views.py
Jens Langhammer d82dfc65b7 api: replace rest_framework browser with rapi-doc
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2021-03-18 20:35:12 +01:00

23 lines
595 B
Python

"""General API Views"""
from typing import Any
from django.urls import reverse
from django.views.generic import TemplateView
class SwaggerView(TemplateView):
"""Show swagger view based on rapi-doc"""
template_name = "api/swagger.html"
def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
path = self.request.build_absolute_uri(
reverse(
"authentik_api:schema-json",
kwargs={
"format": ".json",
},
)
)
return super().get_context_data(path=path, **kwargs)