From ecfa0608772bf927779151ddb7494c1e0b162d6b Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 6 Dec 2024 18:46:20 -0700 Subject: [PATCH 1/2] API response cleanup --- frigate/api/defs/response/event_response.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frigate/api/defs/response/event_response.py b/frigate/api/defs/response/event_response.py index 75cf670dc4..66738d3cf9 100644 --- a/frigate/api/defs/response/event_response.py +++ b/frigate/api/defs/response/event_response.py @@ -1,6 +1,6 @@ from typing import Any, Optional -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict class EventResponse(BaseModel): @@ -10,7 +10,7 @@ class EventResponse(BaseModel): camera: str start_time: float end_time: Optional[float] - false_positive: bool + false_positive: Optional[bool] zones: list[str] thumbnail: str has_clip: bool @@ -22,6 +22,8 @@ class EventResponse(BaseModel): model_type: Optional[str] data: dict[str, Any] + model_config = ConfigDict(extra="forbid", protected_namespaces=()) + class EventCreateResponse(BaseModel): success: bool From 4eb23c241b4c81fcb4592f875cb8a7c6b543660c Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 6 Dec 2024 18:56:43 -0700 Subject: [PATCH 2/2] Remove extra field definition --- frigate/api/defs/response/event_response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/api/defs/response/event_response.py b/frigate/api/defs/response/event_response.py index 66738d3cf9..17b9b166f2 100644 --- a/frigate/api/defs/response/event_response.py +++ b/frigate/api/defs/response/event_response.py @@ -22,7 +22,7 @@ class EventResponse(BaseModel): model_type: Optional[str] data: dict[str, Any] - model_config = ConfigDict(extra="forbid", protected_namespaces=()) + model_config = ConfigDict(protected_namespaces=()) class EventCreateResponse(BaseModel):