docs: add OpenAPI responses={} to all router endpoints
Add explicit HTTP status code documentation to every endpoint across 15 router files. Each endpoint now declares all possible response codes (200/201/204/400/401/404/409/429/502/503) with descriptions so frontend can distinguish error types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -23,9 +23,12 @@ router = APIRouter(prefix="/api/v1/setup", tags=["setup"])
|
||||
|
||||
|
||||
@router.get(
|
||||
"",
|
||||
"/",
|
||||
response_model=SetupStatusResponse,
|
||||
summary="Check whether setup has been completed",
|
||||
responses={
|
||||
200: {"description": "Setup status returned", "model": SetupStatusResponse},
|
||||
},
|
||||
)
|
||||
async def get_setup_status(app: AppDep) -> SetupStatusResponse:
|
||||
"""Return whether the initial setup wizard has been completed.
|
||||
@@ -43,6 +46,11 @@ async def get_setup_status(app: AppDep) -> SetupStatusResponse:
|
||||
response_model=SetupResponse,
|
||||
status_code=status.HTTP_201_CREATED,
|
||||
summary="Run the initial setup wizard",
|
||||
responses={
|
||||
201: {"description": "Setup completed successfully", "model": SetupResponse},
|
||||
400: {"description": "Validation error in request body"},
|
||||
409: {"description": "Setup already completed"},
|
||||
},
|
||||
)
|
||||
async def post_setup(
|
||||
app: AppDep,
|
||||
@@ -88,6 +96,9 @@ async def post_setup(
|
||||
"/timezone",
|
||||
response_model=SetupTimezoneResponse,
|
||||
summary="Return the configured IANA timezone",
|
||||
responses={
|
||||
200: {"description": "Timezone returned", "model": SetupTimezoneResponse},
|
||||
},
|
||||
)
|
||||
async def get_timezone(settings: SettingsDep) -> SetupTimezoneResponse:
|
||||
"""Return the IANA timezone configured during the initial setup wizard.
|
||||
|
||||
Reference in New Issue
Block a user