shubhamraj-git commented on code in PR #46042:
URL: https://github.com/apache/airflow/pull/46042#discussion_r1936105543


##########
airflow/api_fastapi/core_api/datamodels/xcom.py:
##########
@@ -57,3 +57,28 @@ class XComCollection(BaseModel):
 
     xcom_entries: list[XComResponse]
     total_entries: int
+
+
+class XComCreateRequest(BaseModel):
+    """Request body for creating an XCom entry."""
+
+    key: str
+    value: Any
+    map_index: int = -1
+
+
+class XComCreateResponse(BaseModel):
+    """Serializer for a xcom create response."""
+
+    key: str
+    dag_run_id: int
+    timestamp: datetime
+    map_index: int
+    task_id: str
+    dag_id: str
+    run_id: str
+    value: str | None
+
+    @field_validator("value", mode="before")
+    def value_to_string(cls, v):
+        return str(v) if v is not None else None

Review Comment:
   Done, used the existing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to