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

flyrain 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 ce1ce419f9 SPEC: Replace nullable with type arrays in rest catalog 
openapi spec (#18428)
ce1ce419f9 is described below

commit ce1ce419f90354a86ea7a8d7552f8418e4da7a1a
Author: Yong Zheng <[email protected]>
AuthorDate: Fri Nov 27 15:40:23 2026 -0600

    SPEC: Replace nullable with type arrays in rest catalog openapi spec 
(#18428)
---
 open-api/rest-catalog-open-api.py   |  4 ++--
 open-api/rest-catalog-open-api.yaml | 22 +++++++++-------------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/open-api/rest-catalog-open-api.py 
b/open-api/rest-catalog-open-api.py
index 7d9a629d59..f6347e2807 100644
--- a/open-api/rest-catalog-open-api.py
+++ b/open-api/rest-catalog-open-api.py
@@ -96,7 +96,7 @@ class Namespace(RootModel[list[str]]):
 
 class PageToken(RootModel[str | None]):
     root: str | None = 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 [...]
     )
 
@@ -578,7 +578,7 @@ class AssertRefSnapshotId(TableRequirement):
 
     type: Literal['assert-ref-snapshot-id']
     ref: str
-    snapshot_id: int = Field(..., alias='snapshot-id')
+    snapshot_id: int | None = Field(..., alias='snapshot-id')
 
 
 class AssertLastAssignedFieldId(TableRequirement):
diff --git a/open-api/rest-catalog-open-api.yaml 
b/open-api/rest-catalog-open-api.yaml
index 3d95d7732e..494bfb98d4 100644
--- a/open-api/rest-catalog-open-api.yaml
+++ b/open-api/rest-catalog-open-api.yaml
@@ -2471,8 +2471,7 @@ components:
         Clients must interpret either `null` or missing response value of 
`next-page-token` as
         the end of the listing results.
 
-      type: string
-      nullable: true
+      type: [ string, "null" ]
 
     TableIdentifier:
       type: object
@@ -2484,7 +2483,6 @@ components:
           $ref: '#/components/schemas/Namespace'
         name:
           type: string
-          nullable: false
 
     CatalogObjectIdentifier:
       description:
@@ -3801,9 +3799,8 @@ components:
         ref:
           type: string
         snapshot-id:
-          type: integer
+          type: [ integer, "null" ]
           format: int64
-          nullable: true
 
     AssertLastAssignedFieldId:
       description:
@@ -4333,9 +4330,8 @@ components:
         - metadata
       properties:
         metadata-location:
-          type: string
+          type: [ string, "null" ]
           description: May be null if the table is staged as part of a 
transaction
-          nullable: true
         metadata:
           $ref: '#/components/schemas/TableMetadata'
         config:
@@ -5020,17 +5016,18 @@ components:
         namespace:
           $ref: '#/components/schemas/Namespace'
         properties:
-          type: object
+          anyOf:
+            - type: object
+              additionalProperties:
+                type: string
+            - type: "null"
           description:
             Properties stored on the namespace, if supported by the server.
             If the server does not support namespace properties, it should 
return null for this field.
             If namespace properties are supported, but none are set, it should 
return an empty object.
-          additionalProperties:
-            type: string
           examples:
             - { "owner": "Ralph", 'transient_lastDdlTime': '1452120468' }
           default: { }
-          nullable: true
 
     ListTablesResponse:
       type: object
@@ -5359,14 +5356,13 @@ components:
           items:
             type: string
         missing:
-          type: array
+          type: [ array, "null" ]
           items:
             type: string
           description:
             List of properties requested for removal that were not found
             in the namespace's properties. Represents a partial success 
response.
             Server's do not need to implement this.
-          nullable: true
 
     CommitTableResponse:
       type: object

Reply via email to