Skip to content

Commit

Permalink
feat: 確認輸出型別、改善 Swagger UI 呈現的資訊
Browse files Browse the repository at this point in the history
- 新增 Rpage API 回傳值限制及參數說明
  • Loading branch information
iwtba4188 authored and l7wei committed Nov 4, 2023
1 parent 6cc7645 commit 20d456c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/api/routers/rpage.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
from fastapi import APIRouter, HTTPException, Path
from pydantic import HttpUrl
from pydantic import BaseModel, HttpUrl, Field

from ..models.rpage import Rpage


class RpageData(BaseModel):
title: str = Field(..., description="公告標題")
date: str = Field(..., description="公告日期")
url: HttpUrl = Field(..., description="公告網址")


router = APIRouter(
prefix="/rpage",
tags=["rpage"],
Expand Down Expand Up @@ -37,6 +44,7 @@
},
},
},
response_model=list[RpageData],
)
def get_rpage_data(full_path: HttpUrl = Path(..., description="Rpage 完整公告網址")):
"""
Expand Down

0 comments on commit 20d456c

Please sign in to comment.