Skip to content

Commit 3e05034

Browse files
authored
修复fastapi配置变量命名和类型 (#50)
1 parent 04ac845 commit 3e05034

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backend/core/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ class Settings(BaseSettings):
3535
FASTAPI_TITLE: str = 'FastAPI'
3636
FASTAPI_VERSION: str = '0.0.1'
3737
FASTAPI_DESCRIPTION: str = 'FastAPI Best Architecture'
38-
FASTAPI_DOCS_URL: str | None = '/docs'
39-
FASTAPI_REDOCS_URL: str | None = '/redocs'
38+
FASTAPI_DOCS_URL: str = '/docs'
39+
FASTAPI_REDOC_URL: str = '/redoc'
4040
FASTAPI_OPENAPI_URL: str | None = '/openapi'
4141
FASTAPI_STATIC_FILES: bool = False
4242

4343
@model_validator(mode='before')
4444
@classmethod
4545
def validator_api_url(cls, values):
4646
if values['ENVIRONMENT'] == 'pro':
47-
values['OPENAPI_URL'] = None
47+
values['FASTAPI_OPENAPI_URL'] = None
4848
values['FASTAPI_STATIC_FILES'] = False
4949
return values
5050

backend/core/registrar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def register_app():
5050
version=settings.FASTAPI_VERSION,
5151
description=settings.FASTAPI_DESCRIPTION,
5252
docs_url=settings.FASTAPI_DOCS_URL,
53-
redoc_url=settings.FASTAPI_REDOCS_URL,
53+
redoc_url=settings.FASTAPI_REDOC_URL,
5454
openapi_url=settings.FASTAPI_OPENAPI_URL,
5555
lifespan=register_init,
5656
)

0 commit comments

Comments
 (0)