From 5648478e6d413e1fa606e005f06fe0361bd18ab3 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 21 Apr 2024 22:51:36 +0200 Subject: [PATCH] Adjust schema for collection elements of collections that aren't populated --- client/src/api/schema/schema.ts | 7 ++++--- lib/galaxy/schema/schema.py | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 817248b6b43..fa5d31f0fa3 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -3751,7 +3751,7 @@ export interface components { * Element Type * @description The type of the element. Used to interpret the `object` field. */ - element_type: components["schemas"]["DCEType"]; + element_type?: components["schemas"]["DCEType"] | null; /** * Dataset Collection Element ID * @example 0123456789ABCDEF @@ -3767,10 +3767,11 @@ export interface components { * Object * @description The element's specific data depending on the value of `element_type`. */ - object: + object?: | components["schemas"]["HDAObject"] | components["schemas"]["HDADetailed"] - | components["schemas"]["DCObject"]; + | components["schemas"]["DCObject"] + | null; }; /** * DCEType diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 277bb82f481..5badff54396 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -971,13 +971,13 @@ class DCESummary(Model, WithModelClass): title="Element Identifier", description="The actual name of this element.", ) - element_type: DCEType = Field( - ..., + element_type: Optional[DCEType] = Field( + None, title="Element Type", description="The type of the element. Used to interpret the `object` field.", ) - object: Union[HDAObject, HDADetailed, DCObject] = Field( - ..., + object: Optional[Union[HDAObject, HDADetailed, DCObject]] = Field( + None, title="Object", description="The element's specific data depending on the value of `element_type`.", )