Skip to content

Commit

Permalink
Type collections in return model of execute oerpation
Browse files Browse the repository at this point in the history
  • Loading branch information
heisner-tillman committed Apr 3, 2024
1 parent 76a53d9 commit c9fb2d7
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions lib/galaxy/schema/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,29 @@
Field,
field_validator,
)
from typing_extensions import Annotated

from galaxy.schema.fields import DecodedDatabaseIdField
from galaxy.schema.jobs import (
EncodedJobDetails,
ShowFullJobResponse,
)
from galaxy.schema.schema import (
HDCADetailed,
HDCASummary,
JobSummary,
Model,
)

ToolOutputName = Annotated[
str,
Field(
...,
title="Output Name",
description="The name of the tool output",
),
]


class ExecuteToolPayload(Model):
tool_id: Optional[Any] = Field(
Expand Down Expand Up @@ -96,13 +108,24 @@ def inputs_string_to_json(cls, v):
model_config = ConfigDict(extra="allow")


class ExtendedHDCASummary(HDCASummary):
output_name: ToolOutputName


class ExtendedHDCADetailed(HDCADetailed):
output_name: ToolOutputName


ExtendedAnyHDCA = Union[ExtendedHDCADetailed, ExtendedHDCASummary]


class ToolResponse(Model):
outputs: List[Dict[str, Any]] = Field(
default=[],
title="Outputs",
description="The outputs of the tool.",
)
output_collections: List[Dict[str, Any]] = Field(
output_collections: List[ExtendedAnyHDCA] = Field(
default=[],
title="Output Collections",
description="The output dataset collections of the tool.",
Expand All @@ -112,7 +135,7 @@ class ToolResponse(Model):
title="Jobs",
description="The jobs of the tool.",
)
implicit_collections: List[Dict[str, Any]] = Field(
implicit_collections: List[ExtendedAnyHDCA] = Field(
default=[],
title="Implicit Collections",
description="The implicit dataset collections of the tool.",
Expand Down

0 comments on commit c9fb2d7

Please sign in to comment.