Swagger UI Ready

This commit is contained in:
JakeBreath
2026-08-05 18:20:53 -05:00
parent 7485103bb2
commit 91dbb675d4
10 changed files with 610 additions and 1 deletions
+15 -1
View File
@@ -1,3 +1,17 @@
from pathlib import Path
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
SPEC_PATH = Path(__file__).parent / 'openapi.yaml'
def api_docs(request):
"""Interactive OpenAPI documentation (Swagger UI), gated like the rest."""
return render(request, 'api/docs.html')
def api_docs_spec(request):
"""The OpenAPI spec served to Swagger UI (YAML, gated)."""
with open(SPEC_PATH, 'rb') as fh:
return HttpResponse(fh.read(), content_type='application/yaml; charset=utf-8')