From 2763c484d66e0f7559ddf21ea2dfbfe4f8892d7e Mon Sep 17 00:00:00 2001 From: jasta Date: Sun, 18 Aug 2024 10:43:57 +0900 Subject: [PATCH] fix: HttpUrl type specified --- api/birdxplorer_api/routers/data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/birdxplorer_api/routers/data.py b/api/birdxplorer_api/routers/data.py index 4900401..2ef6145 100644 --- a/api/birdxplorer_api/routers/data.py +++ b/api/birdxplorer_api/routers/data.py @@ -3,6 +3,7 @@ from dateutil.parser import parse as dateutil_parse from fastapi import APIRouter, HTTPException, Query, Request +from pydantic import HttpUrl from birdxplorer_common.models import ( BaseModel, @@ -127,7 +128,7 @@ def get_posts( total_count = len(posts) paginated_posts = posts[offset : offset + limit] for post in paginated_posts: - post.link = f"https://x.com/{post.x_user.name}/status/{post.post_id}" + post.link = HttpUrl(f"https://x.com/{post.x_user.name}/status/{post.post_id}") base_url = str(request.url).split("?")[0] next_offset = offset + limit