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

laskoviymishka 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 0e7a36d48f OpenAPI: Add VariantType to the REST catalog spec (#17256)
0e7a36d48f is described below

commit 0e7a36d48ff83792bfeb72eaff2dd2d7fae60eb3
Author: Neelesh Salian <[email protected]>
AuthorDate: Sun Aug 2 10:16:30 2026 -0700

    OpenAPI: Add VariantType to the REST catalog spec (#17256)
    
    * OpenAPI, Core: Add VariantType to the REST catalog spec
    
    Co-authored-by: Amogh Jahagirdar <[email protected]>
    
    * PR Comments
    
    * comment for ordering
    
    * cleanup comment
    
    * Drop redundant not-variant exclusion from PrimitiveType
    
    ---------
    
    Co-authored-by: Amogh Jahagirdar <[email protected]>
---
 open-api/rest-catalog-open-api.py   | 8 ++++++--
 open-api/rest-catalog-open-api.yaml | 6 ++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/open-api/rest-catalog-open-api.py 
b/open-api/rest-catalog-open-api.py
index 5957a5785a..5e3580ae38 100644
--- a/open-api/rest-catalog-open-api.py
+++ b/open-api/rest-catalog-open-api.py
@@ -122,6 +122,10 @@ class PrimitiveType(RootModel[str]):
     root: str = Field(..., examples=[['long', 'string', 'fixed[16]', 
'decimal(10,2)']])
 
 
+class VariantType(RootModel[Literal['variant']]):
+    root: Literal['variant']
+
+
 class ExpressionType(RootModel[str]):
     root: str = Field(
         ...,
@@ -2089,8 +2093,8 @@ class Schema(StructType):
     identifier_field_ids: list[int] | None = Field(None, 
alias='identifier-field-ids')
 
 
-class Type(RootModel[PrimitiveType | StructType | ListType | MapType]):
-    root: PrimitiveType | StructType | ListType | MapType
+class Type(RootModel[VariantType | PrimitiveType | StructType | ListType | 
MapType]):
+    root: VariantType | PrimitiveType | StructType | ListType | MapType
 
 
 class Predicate(
diff --git a/open-api/rest-catalog-open-api.yaml 
b/open-api/rest-catalog-open-api.yaml
index 6ce85b32d8..e9a530a128 100644
--- a/open-api/rest-catalog-open-api.yaml
+++ b/open-api/rest-catalog-open-api.yaml
@@ -2429,6 +2429,10 @@ components:
         - "fixed[16]"
         - "decimal(10,2)"
 
+    VariantType:
+      type: string
+      const: "variant"
+
     StructField:
       type: object
       required:
@@ -2509,7 +2513,9 @@ components:
           type: boolean
 
     Type:
+      # Keep VariantType first, or the generated client resolves `variant` as 
PrimitiveType.
       oneOf:
+        - $ref: '#/components/schemas/VariantType'
         - $ref: '#/components/schemas/PrimitiveType'
         - $ref: '#/components/schemas/StructType'
         - $ref: '#/components/schemas/ListType'

Reply via email to