-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from phin09/feature/api-documentation
CREATE: API document with endpoint /swagger
- Loading branch information
Showing
7 changed files
with
158 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
from django.urls import path, include | ||
from django.conf.urls import url | ||
|
||
from rest_framework import permissions | ||
from drf_yasg.views import get_schema_view | ||
from drf_yasg import openapi | ||
|
||
urlpatterns = [ | ||
path('user', include('user.urls')), | ||
path('feed', include('feed.urls')), | ||
path('product', include('product.urls')) | ||
path('user', include('user.urls')), | ||
path('feed', include('feed.urls')), | ||
path('product', include('product.urls')), | ||
] | ||
|
||
# api documentation: drf-yasg 사용. | ||
# 이를 위해 settings.py INSTALLED_APPS에 rest_framework와 drf_yasg를 추가하고 | ||
# django.contrib.admin와 django.contrib.auth 주석을 해제함. | ||
schema_view = get_schema_view( | ||
openapi.Info( | ||
title="style-we API", | ||
default_version='v1.0.0', | ||
description="style-we project API document", | ||
), | ||
validators=['flex'], | ||
public=True, | ||
permission_classes=[permissions.AllowAny], | ||
) | ||
|
||
urlpatterns += [ | ||
url(r'^swagger$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters