File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
packages/models-library/src/models_library Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1313
1414from models_library .basic_types import ConstrainedStr , KeyIDStr
1515from pydantic import (
16+ AfterValidator ,
1617 AnyUrl ,
1718 BaseModel ,
1819 ConfigDict ,
@@ -122,7 +123,9 @@ class PortLink(BaseModel):
122123class DownloadLink (BaseModel ):
123124 """I/O port type to hold a generic download link to a file (e.g. S3 pre-signed link, etc)"""
124125
125- download_link : AnyUrl = Field (..., alias = "downloadLink" )
126+ download_link : Annotated [AnyUrl , AfterValidator (str )] = Field (
127+ ..., alias = "downloadLink"
128+ )
126129 label : str | None = Field (default = None , description = "Display name" )
127130 model_config = ConfigDict (
128131 extra = "forbid" ,
Original file line number Diff line number Diff line change 55from copy import deepcopy
66from typing import Any
77
8- from pydantic import BaseModel
8+ from pydantic import BaseModel , TypeAdapter
99
1010from ..projects import Project
1111from ..projects_nodes_io import NodeID , PortLink , UUIDStr
@@ -20,7 +20,7 @@ def project_node_io_payload_cb(
2020
2121 async def node_io_payload_cb (node_id : NodeID ) -> dict [str , Any ]:
2222 node_io_payload : dict [str , Any ] = {"inputs" : None , "outputs" : None }
23- node = project .workbench .get (UUIDStr (node_id ))
23+ node = project .workbench .get (TypeAdapter ( UUIDStr ). validate_python (node_id ))
2424 if node :
2525 node_io_payload = {"inputs" : node .inputs , "outputs" : node .outputs }
2626
You can’t perform that action at this time.
0 commit comments