Add empty-string credential validator to VantageSettingsUpdate

Matches the existing validator on VantageInitRequest so that empty or
whitespace-only api_key/integration_token values are rejected at update
time rather than silently persisted and failing at the next export.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Harshit28j 2026-03-11 17:41:23 +05:30
parent 212cd0e4aa
commit 358c2fd033

View file

@ -95,3 +95,10 @@ class VantageSettingsUpdate(BaseModel):
None, description="New Vantage integration token"
)
base_url: Optional[str] = Field(None, description="New Vantage API base URL")
@field_validator("api_key", "integration_token")
@classmethod
def must_be_non_empty(cls, v: Optional[str]) -> Optional[str]:
if v is not None and not v.strip():
raise ValueError("must be a non-empty string")
return v