From 69cd883bab41981241fc8b1c78ddc835d54cc087 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:19:12 +0100 Subject: [PATCH] Fix OpenAPI docs not rendering There is a regression bug in FastAPI/Pydantic (see https://github.com/tiangolo/fastapi/issues/3665) that prevents the OpenAPI interactive documentation to render when we have models using `Tuple`. Since Tuple is currently used just in one place, we can temporarily replace it with a simple List, we will lose a bit of validation but still is not worth reverting back to a previous version of FastAPI because of this. --- lib/galaxy/schema/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 9d9de10c2ef..9dedd59112b 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -8,7 +8,6 @@ from typing import ( Dict, List, Optional, - Tuple, Union, ) @@ -2042,7 +2041,8 @@ class RoleListModel(BaseModel): # The tuple should probably be another proper model instead? # Keeping it as a Tuple for now for backward compatibility -RoleNameIdTuple = Tuple[str, EncodedDatabaseIdField] +# TODO: Use Tuple again when https://github.com/tiangolo/fastapi/issues/3665 is fixed upstream +RoleNameIdTuple = List[str] # Tuple[str, EncodedDatabaseIdField] # Group_Roles -----------------------------------------------------------------