File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
src/models_library/api_schemas_catalog
services/catalog/src/simcore_service_catalog/api/rest Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1616class ServicePortGet (BaseModel ):
1717 key : str = Field (
1818 ...,
19- description = "port identifier name" ,
19+ description = "Port identifier name" ,
2020 pattern = PUBLIC_VARIABLE_NAME_RE ,
2121 title = "Key name" ,
2222 )
@@ -26,6 +26,7 @@ class ServicePortGet(BaseModel):
2626 None ,
2727 description = "jsonschema for the port's value. SEE https://json-schema.org/understanding-json-schema/" ,
2828 )
29+
2930 model_config = ConfigDict (
3031 json_schema_extra = {
3132 "example" : {
@@ -43,7 +44,7 @@ class ServicePortGet(BaseModel):
4344 )
4445
4546 @classmethod
46- def from_service_io (
47+ def from_domain_model (
4748 cls ,
4849 kind : PortKindStr ,
4950 key : str ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def test_service_port_with_file():
2121 }
2222 )
2323
24- port = ServicePortGet .from_service_io ("input" , "input_1" , io ).model_dump (
24+ port = ServicePortGet .from_domain_model ("input" , "input_1" , io ).model_dump (
2525 exclude_unset = True
2626 )
2727
@@ -49,7 +49,7 @@ def test_service_port_with_boolean():
4949 }
5050 )
5151
52- port = ServicePortGet .from_service_io ("input" , "input_1" , io ).model_dump (
52+ port = ServicePortGet .from_domain_model ("input" , "input_1" , io ).model_dump (
5353 exclude_unset = True
5454 )
5555
Original file line number Diff line number Diff line change @@ -31,10 +31,18 @@ async def list_service_ports(
3131
3232 if service .inputs :
3333 for name , input_port in service .inputs .items ():
34- ports .append (ServicePortGet .from_service_io ("input" , name , input_port ))
34+ ports .append (
35+ ServicePortGet .from_domain_model (
36+ kind = "input" , key = name , port = input_port
37+ )
38+ )
3539
3640 if service .outputs :
3741 for name , output_port in service .outputs .items ():
38- ports .append (ServicePortGet .from_service_io ("output" , name , output_port ))
42+ ports .append (
43+ ServicePortGet .from_domain_model (
44+ kind = "output" , key = name , port = output_port
45+ )
46+ )
3947
4048 return ports
You can’t perform that action at this time.
0 commit comments