Skip to content

Commit

Permalink
feat: added swagger api docs (#132)
Browse files Browse the repository at this point in the history
* added swagger api docs

* Update base.py
  • Loading branch information
Bhavik-ag authored Mar 7, 2024
1 parent 84dc675 commit 2e29c1b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'django_extensions',
'rest_framework',
'django_filters',
'drf_yasg',
'core',
'accounts',
'products',
Expand Down
14 changes: 14 additions & 0 deletions backend/core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
from django.conf.urls import include
from django.conf.urls.static import static
from django.conf import settings
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

from .views import stripe_webhook

schema_view = get_schema_view(
openapi.Info(
title="GetIt API",
default_version='v1',
description="API Documentation"
),
public=True,
permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
path('admin/', admin.site.urls),
path('api/token/', include('auth.urls')),
path('api/accounts/', include('accounts.urls')),
path('api/events/', include('events.urls')),
path('api/tickets/', include('tickets.urls')),
path('api/stripe/webhook/', stripe_webhook, name='stripe-webhook'),
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ tomli==2.0.1
typing_extensions==4.6.3
tzdata==2022.6
stripe
drf-yasg==1.21.7

0 comments on commit 2e29c1b

Please sign in to comment.