Skip to content

Commit ebdf753

Browse files
add authorization methods in swagger
1 parent a78096e commit ebdf753

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

app/__init__.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,31 @@ def missing_token_callback(error):
6767
"model_filter": lambda tag: True, # all in
6868
}
6969
],
70-
'specs_route': '/',
70+
'components': {
71+
'securitySchemes': {
72+
'access_token': {
73+
'type': 'http',
74+
'scheme': 'bearer',
75+
'bearerFormat': 'JWT',
76+
'description': 'Enter your JWT access token'
77+
},
78+
'refresh_token': {
79+
'type': 'http',
80+
'scheme': 'bearer',
81+
'bearerFormat': 'JWT',
82+
'description': 'Enter your JWT refresh token'
83+
}
84+
}
85+
},
86+
'specs_route': '/'
7187
}
7288

7389
template = {
7490
'tags': [
7591
{'name': 'Category', 'description': 'Operations with categories'},
7692
{'name': 'Subcategory', 'description': 'Operations with subategories'},
77-
{'name': 'Product', 'description': 'Operations with products'}
93+
{'name': 'Product', 'description': 'Operations with products'},
94+
{'name': 'User', 'description': 'Operations with users'},
7895
]
7996
}
8097
swagger = Swagger(app, template=template, config=swagger_config, merge=True)

0 commit comments

Comments
 (0)