Skip to content

Commit

Permalink
Split model InputConnections into more specific models to use them in…
Browse files Browse the repository at this point in the history
… different step models
  • Loading branch information
heisner-tillman committed Jun 6, 2024
1 parent 4567ccc commit ec9f3aa
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/galaxy/schema/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,30 @@ class WorkflowDictExportStepInput(Model):
description: str = Field(..., title="Description", description="The annotation or description of the input.")


class InputConnection(Model):
class InputConnectionBase(Model):
id: int = Field(..., title="ID", description="The order index of the step.")
output_name: str = Field(
...,
title="Output Name",
description="The output name of the input step that serves as the source for this connection.",
)


class InputConnectionExport(InputConnectionBase):
input_subworkflow_step_id: Optional[int] = Field(
None,
title="Input Subworkflow Step ID",
)


class InputConnectionEditor(InputConnectionBase):
input_type: str = Field(
...,
title="Input Type",
description="The input type of the workflow step.",
)


class WorkflowStepLayoutPosition(Model):
"""Position and dimensions of the workflow step represented by a box on the graph."""

Expand Down Expand Up @@ -769,7 +780,8 @@ class WorkflowDictEditorStep(WorkflowDictStepsExtendedBase):
title="Tooltip",
description="The tooltip for the step.",
)
input_connections: Optional[Dict[str, Any]] = Field(
input_connections: Optional[Dict[str, Union[InputConnectionEditor, List[InputConnectionEditor]]]] = Field(
# input_connections: Optional[Dict[str, Any]] = Field(
None,
title="Input Connections",
description="The input connections for the step.",
Expand Down Expand Up @@ -824,7 +836,7 @@ class WorkflowDictExportStep(WorkflowDictStepsExtendedBase):
description="The inputs of the step.",
)
in_parameter: Optional[Dict[str, StepIn]] = Field(None, title="In", alias="in")
input_connections: Optional[Dict[str, Union[InputConnection, List[InputConnection]]]] = Field(
input_connections: Optional[Dict[str, Union[InputConnectionExport, List[InputConnectionExport]]]] = Field(
None,
title="Input Connections",
description="The input connections of the step.",
Expand Down

0 comments on commit ec9f3aa

Please sign in to comment.