Skip to content

Commit fc4a680

Browse files
author
PRITAM CHAKRABORTY
committed
Swagger Done for v1
1 parent 34195eb commit fc4a680

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

blogapp/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# all_blogger_blogs.register('blogs', OwnerBlogListVSet, 'blogs')
1414

1515

16-
1716
comment_router = NestedDefaultRouter(all_blogger_blogs, 'blog', lookup='blog')
1817
comment_router.register('comments', CommentVSet, basename='comments')
1918

core/settings/common.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@
6363
ROOT_URLCONF = 'core.urls'
6464

6565

66-
SWAGGER_SETTINGS = {"DEFAULT_AUTO_SCHEMA_CLASS": "blogapp.swagger_schema.CustomAutoSchema"}
66+
SWAGGER_SETTINGS = {
67+
"DEFAULT_AUTO_SCHEMA_CLASS": "blogapp.swagger_schema.CustomAutoSchema",
68+
"LOGIN_URL": 'admin/',
69+
"LOGOUT_URL":'admin/logout',
70+
"OPERATIONS_SORTER":'method',
71+
"TAGS_SORTER":'alpha',
72+
"DOC_EXPANSION":"none",
73+
}
6774

6875
TEMPLATES = [
6976
{
@@ -135,7 +142,9 @@
135142
),
136143
'DEFAULT_PERMISSION_CLASSES': [
137144
'rest_framework.permissions.IsAuthenticatedOrReadOnly',
138-
]
145+
],
146+
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
147+
'PAGE_SIZE': 5,
139148
}
140149

141150
SIMPLE_JWT = {

core/urls.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
openapi.Info(
2929
title="Blogapp API",
3030
default_version='v1',
31-
description="Test description",
31+
description="""
32+
# This is the `Blogapp API` documentation
33+
34+
> ### Here all the api routes are grouped by tags
35+
36+
""",
3237
# terms_of_service="https://www.google.com/policies/terms/",
3338
# contact=openapi.Contact(email="pritam.chk98@gmail.com"),
3439
# license=openapi.License(name="BSD License"),

db.sqlite3

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)