Skip to content

Commit

Permalink
Drop HistoryMinimal to preserve API behavior for "keys"
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Mar 14, 2024
1 parent dc6c47e commit 2bd2dc1
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,16 +1204,15 @@ class UpdateHistoryContentsPayload(HistoryBase):
)


class HistoryMinimal(HistoryBase, WithModelClass):
"""Minimal History Response with optional fields"""
class CustomHistoryView(HistoryBase):
"""History Response with all optional fields.
model_class: HISTORY_MODEL_CLASS = ModelClassField(HISTORY_MODEL_CLASS)
id: Optional[HistoryID] = None
user_id: Optional[EncodedDatabaseIdField] = Field(
None,
title="User ID",
description="The encoded ID of the user that owns this History.",
)
It is used for serializing only specific attributes using the "keys"
query parameter. Unfortunately, we cannot know the exact fields that
will be requested, so we have to allow all fields to be optional.
"""

pass


class HistorySummary(HistoryBase, WithModelClass):
Expand Down Expand Up @@ -1341,10 +1340,13 @@ class HistoryDetailed(HistorySummary): # Equivalent to 'dev-detailed' view, whi
)


AnyHistoryView = Union[
HistoryDetailed,
HistorySummary,
HistoryMinimal,
AnyHistoryView = Annotated[
Union[
HistorySummary,
HistoryDetailed,
CustomHistoryView,
],
Field(union_mode="left_to_right"),
]


Expand Down

0 comments on commit 2bd2dc1

Please sign in to comment.