Set default factory for optional dictionary fields in GenerateUrlRequest parameter

This commit is contained in:
mhdzumair
2024-11-16 11:11:27 +05:30
parent bcf22d223c
commit 57a4202605
+5 -3
View File
@@ -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."
)