diff --git a/lib/galaxy/webapps/galaxy/api/folder_contents.py b/lib/galaxy/webapps/galaxy/api/folder_contents.py index 6b6fbffdd0a9..0c8f1f5e165c 100644 --- a/lib/galaxy/webapps/galaxy/api/folder_contents.py +++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py @@ -36,10 +36,11 @@ Path(..., title="Folder ID", description="The encoded identifier of the library folder."), ] -LimitQueryParam: int = Query(default=10, title="Limit", description="Maximum number of contents to return.") +LimitQueryParam: int = Query(default=10, ge=1, title="Limit", description="Maximum number of contents to return.") OffsetQueryParam: int = Query( default=0, + ge=0, title="Offset", description="Return contents from this specified position. For example, if ``limit`` is set to 100 and ``offset`` to 200, contents between position 200-299 will be returned.", ) diff --git a/lib/galaxy/webapps/galaxy/api/jobs.py b/lib/galaxy/webapps/galaxy/api/jobs.py index 7d0d2757b333..089a226058c7 100644 --- a/lib/galaxy/webapps/galaxy/api/jobs.py +++ b/lib/galaxy/webapps/galaxy/api/jobs.py @@ -161,10 +161,11 @@ description="Sort results by specified field.", ) -LimitQueryParam: int = Query(default=500, title="Limit", description="Maximum number of jobs to return.") +LimitQueryParam: int = Query(default=500, ge=1, title="Limit", description="Maximum number of jobs to return.") OffsetQueryParam: int = Query( default=0, + ge=0, title="Offset", description="Return jobs starting from this specified position. For example, if ``limit`` is set to 100 and ``offset`` to 200, jobs 200-299 will be returned.", ) diff --git a/lib/galaxy/webapps/galaxy/api/pages.py b/lib/galaxy/webapps/galaxy/api/pages.py index e098e9870e48..61aaea66ead0 100644 --- a/lib/galaxy/webapps/galaxy/api/pages.py +++ b/lib/galaxy/webapps/galaxy/api/pages.py @@ -72,10 +72,11 @@ description="Sort in descending order?", ) -LimitQueryParam: int = Query(default=100, lt=1000, title="Limit number of queries.") +LimitQueryParam: int = Query(default=100, ge=1, lt=1000, title="Limit number of queries.") OffsetQueryParam: int = Query( default=0, + ge=0, title="Number of pages to skip in sorted query (to enable pagination).", ) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 54386e7596c6..2fef4d09e3fe 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -815,10 +815,11 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): description="Sort in descending order?", ) -LimitQueryParam: Optional[int] = Query(default=None, title="Limit number of queries.") +LimitQueryParam: Optional[int] = Query(default=None, ge=1, title="Limit number of queries.") OffsetQueryParam: Optional[int] = Query( default=0, + ge=0, title="Number of workflows to skip in sorted query (to enable pagination).", ) @@ -1229,6 +1230,7 @@ def show_workflow( InvocationsLimitQueryParam = Annotated[ Optional[int], Query( + ge=1, title="Limit", description="Limit the number of invocations to return.", ), @@ -1237,6 +1239,7 @@ def show_workflow( InvocationsOffsetQueryParam = Annotated[ Optional[int], Query( + ge=0, title="Offset", description="Number of invocations to skip.", ),