From 57a42026055ac22cfbfc165fc7d2ec0b9ce66b6d Mon Sep 17 00:00:00 2001 From: mhdzumair Date: Sat, 16 Nov 2024 11:11:27 +0530 Subject: [PATCH] Set default factory for optional dictionary fields in GenerateUrlRequest parameter --- mediaflow_proxy/schemas.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mediaflow_proxy/schemas.py b/mediaflow_proxy/schemas.py index a29e46d..e8ab6b1 100644 --- a/mediaflow_proxy/schemas.py +++ b/mediaflow_proxy/schemas.py @@ -7,9 +7,11 @@ class GenerateUrlRequest(BaseModel): mediaflow_proxy_url: str = Field(..., description="The base URL for the mediaflow proxy.") endpoint: str | None = Field(None, description="The specific endpoint to be appended to the base URL.") destination_url: str | None = Field(None, description="The destination URL to which the request will be proxied.") - query_params: dict | None = Field(None, description="Query parameters to be included in the request.") - request_headers: dict | None = Field(None, description="Headers to be included in the request.") - response_headers: dict | None = Field(None, description="Headers to be included in the response.") + query_params: dict | None = Field( + default_factory=dict, description="Query parameters to be included in the request." + ) + request_headers: dict | None = Field(default_factory=dict, description="Headers to be included in the request.") + response_headers: dict | None = Field(default_factory=dict, description="Headers to be included in the response.") expiration: int | None = Field( None, description="Expiration time for the URL in seconds. If not provided, the URL will not expire." )