From 479f1ee94a3dc219a1009b84784ddeedb1f75c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:33:08 +0000 Subject: [PATCH] fix(api): Use list[Any] for strengths to preserve V2 fields Pydantic was coercing V2 StrengthToProtect dicts to the partial ReportStrengthResponse type, dropping fields like `percentage` and `top_quotes`. Changed to list[Any] to pass through raw data. Co-Authored-By: Claude Opus 4.5 --- api/routes/reviewiq_analytics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/routes/reviewiq_analytics.py b/api/routes/reviewiq_analytics.py index d65923c..f6a3841 100644 --- a/api/routes/reviewiq_analytics.py +++ b/api/routes/reviewiq_analytics.py @@ -373,7 +373,8 @@ class SynthesisResponse(BaseModel): # The Strengths (can be v1 or v2 format depending on report_version) # V1: list[ReportStrengthResponse], V2: list[StrengthToProtect dict] - strengths: list[ReportStrengthResponse] | list[dict] = Field(default_factory=list, description="Key strengths to protect") + # Using list[Any] to prevent Pydantic from coercing/dropping fields + strengths: list[Any] = Field(default_factory=list, description="Key strengths to protect") # Momentum momentum: str = Field("stable", description="improving/declining/stable")