diff --git a/lib/galaxy/webapps/base/api.py b/lib/galaxy/webapps/base/api.py index ad0ac2d8a781..38eb01d382ce 100644 --- a/lib/galaxy/webapps/base/api.py +++ b/lib/galaxy/webapps/base/api.py @@ -239,19 +239,15 @@ def add_request_id_middleware(app: FastAPI): def include_all_package_routers(app: FastAPI, package_name: str): responses: typing.Dict[typing.Union[int, str], typing.Dict[str, typing.Any]] = { - 422: { - "description": "Validation error", + "4XX": { + "description": "Client Error", "model": MessageExceptionModel, }, - } - for code, error in error_codes_by_int_code.items(): - code_int = int(str(code)[:3]) - if code_int in [0, 204] or code_int in responses: - continue - responses[code_int] = { - "description": str(error), + "5XX": { + "description": "Server Error", "model": MessageExceptionModel, - } + }, + } for _, module in walk_controller_modules(package_name): router = getattr(module, "router", None) if router: