fix: 修复swagger接口文档中schema不正确的问题
This commit is contained in:
parent
4a043cf4be
commit
6f84239e8b
@ -20,3 +20,10 @@ class CustomSwaggerAutoSchema(SwaggerAutoSchema):
|
|||||||
if "api" in tags and operation_keys:
|
if "api" in tags and operation_keys:
|
||||||
return [tags_dict.get(operation_keys[1]) if operation_keys[1] in tags_dict else operation_keys[1]]
|
return [tags_dict.get(operation_keys[1]) if operation_keys[1] in tags_dict else operation_keys[1]]
|
||||||
return tags
|
return tags
|
||||||
|
def get_schema(self, request=None, public=False):
|
||||||
|
schema = super().get_schema(request, public)
|
||||||
|
if request.is_secure():
|
||||||
|
schema.schemes = ['https']
|
||||||
|
else:
|
||||||
|
schema.schemes = ['http']
|
||||||
|
return schema
|
||||||
@ -26,6 +26,8 @@ DATABASES = {
|
|||||||
'default': CONFIG.get_db_setting()
|
'default': CONFIG.get_db_setting()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user