This is an automated email from the ASF dual-hosted git repository.

blue pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 5d58750841 Spec: Fix REST pagination requirements based on new 
feedback (#9917)
5d58750841 is described below

commit 5d58750841d3a35a352fcf99d315f10626399e71
Author: Rahil C <[email protected]>
AuthorDate: Fri Mar 22 17:58:14 2024 -0400

    Spec: Fix REST pagination requirements based on new feedback (#9917)
    
    Co-authored-by: Rahil Chertara <[email protected]>
---
 open-api/rest-catalog-open-api.py   |  6 +++---
 open-api/rest-catalog-open-api.yaml | 26 ++++++++++++++++++++------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/open-api/rest-catalog-open-api.py 
b/open-api/rest-catalog-open-api.py
index 77dcad9cfb..7bd97b6988 100644
--- a/open-api/rest-catalog-open-api.py
+++ b/open-api/rest-catalog-open-api.py
@@ -78,9 +78,9 @@ class Namespace(BaseModel):
 
 
 class PageToken(BaseModel):
-    __root__: str = Field(
-        ...,
-        description='An opaque token which allows clients to make use of 
pagination for a list API (e.g. ListTables). Clients will initiate the first 
paginated request by sending an empty `pageToken` e.g. `GET /tables?pageToken` 
or `GET /tables?pageToken=` signaling to the service that the response should 
be paginated.\nServers that support pagination will recognize `pageToken` and 
return a `next-page-token` in response if there are more results available. 
After the initial request, it i [...]
+    __root__: Optional[str] = Field(
+        None,
+        description='An opaque token that allows clients to make use of 
pagination for list APIs (e.g. ListTables). Clients may initiate the first 
paginated request by sending an empty query parameter `pageToken` to the 
server.\nServers that support pagination should identify the `pageToken` 
parameter and return a `next-page-token` in the response if there are more 
results available.  After the initial request, the value of `next-page-token` 
from each response must be used as the `pageTo [...]
     )
 
 
diff --git a/open-api/rest-catalog-open-api.yaml 
b/open-api/rest-catalog-open-api.yaml
index 77aabc834a..161d5e0fcf 100644
--- a/open-api/rest-catalog-open-api.yaml
+++ b/open-api/rest-catalog-open-api.yaml
@@ -1610,14 +1610,28 @@ components:
 
     PageToken:
       description:
-        An opaque token which allows clients to make use of pagination for a 
list API (e.g. ListTables). 
-        Clients will initiate the first paginated request by sending an empty 
`pageToken` e.g. `GET /tables?pageToken` or `GET /tables?pageToken=`
-        signaling to the service that the response should be paginated.
+        An opaque token that allows clients to make use of pagination for list 
APIs
+        (e.g. ListTables). Clients may initiate the first paginated request by 
sending an empty
+        query parameter `pageToken` to the server.
+        
+        Servers that support pagination should identify the `pageToken` 
parameter and return a
+        `next-page-token` in the response if there are more results available. 
 After the initial
+        request, the value of `next-page-token` from each response must be 
used as the `pageToken`
+        parameter value for the next request. The server must return `null` 
value for the
+        `next-page-token` in the last response.
+        
+        Servers that support pagination must return all results in a single 
response with the value
+        of `next-page-token` set to `null` if the query parameter `pageToken` 
is not set in the
+        request.
+        
+        Servers that do not support pagination should ignore the `pageToken` 
parameter and return
+        all results in a single response. The `next-page-token` must be 
omitted from the response.
+    
+        Clients must interpret either `null` or missing response value of 
`next-page-token` as
+        the end of the listing results.
 
-        Servers that support pagination will recognize `pageToken` and return 
a `next-page-token` in response if there are more results available.
-        After the initial request, it is expected that the value of 
`next-page-token` from the last response is used in the subsequent request.
-        Servers that do not support pagination will ignore `next-page-token` 
and return all results.
       type: string
+      nullable: true
 
     TableIdentifier:
       type: object

Reply via email to