|
1 | 1 | """Represents URL endpoints for an application."""
|
2 | 2 | from typing import Any, List
|
3 | 3 | from django.urls import include, path
|
| 4 | +from rest_framework import permissions |
| 5 | +from drf_yasg.views import get_schema_view |
| 6 | +from drf_yasg import openapi |
4 | 7 | from .views import QuoteDetail, Quotes
|
5 | 8 |
|
| 9 | + |
6 | 10 | urlpatterns: List[Any] = [
|
7 | 11 | path("", Quotes.as_view()),
|
8 | 12 | path("<int:pk>", QuoteDetail.as_view()),
|
9 | 13 | path("api-auth/", include("rest_framework.urls")),
|
| 14 | + path( |
| 15 | + "docs/", |
| 16 | + get_schema_view( |
| 17 | + openapi.Info( |
| 18 | + title="Quotes REST API", |
| 19 | + default_version="v1", |
| 20 | + description="Swagger documentation for Quotes REST API", |
| 21 | + terms_of_service="https://www.google.com/policies/terms/", |
| 22 | + contact=openapi. Contact( email="[email protected]"), |
| 23 | + license=openapi.License(name="MIT License"), |
| 24 | + ), |
| 25 | + public=True, |
| 26 | + permission_classes=(permissions.AllowAny,), |
| 27 | + ).with_ui("swagger", cache_timeout=0), |
| 28 | + name="schema-swagger-ui", |
| 29 | + ), |
10 | 30 | ]
|
0 commit comments