From e6a032360402bd58d1f96edf9915c1c54bc268c2 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 29 Apr 2026 15:33:19 -0700 Subject: [PATCH 1/3] OpenAPI: Add CatalogObjectIdentifier and CatalogObjectType schemas Introduces two related REST schemas: - CatalogObjectIdentifier: a bare array of hierarchical levels that references a catalog object (table, view, or namespace). The object kind is determined by context (e.g. the endpoint or a companion CatalogObjectType discriminator), not by the identifier structure alone. - CatalogObjectType: an enum of "table", "view", and "namespace" intended to be used as a discriminator alongside CatalogObjectIdentifier. Also regenerates rest-catalog-open-api.py to match. Co-Authored-By: Claude Opus 4.7 (1M context) --- open-api/rest-catalog-open-api.py | 18 ++++++++++++++++++ open-api/rest-catalog-open-api.yaml | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/open-api/rest-catalog-open-api.py b/open-api/rest-catalog-open-api.py index f8b3f5bd3771..3a7ff8b5facb 100644 --- a/open-api/rest-catalog-open-api.py +++ b/open-api/rest-catalog-open-api.py @@ -106,6 +106,24 @@ class TableIdentifier(BaseModel): name: str +class CatalogObjectIdentifier(RootModel[list[str]]): + """ + Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion CatalogObjectType discriminator), not by the identifier structure alone. + """ + + root: list[str] = Field( + ..., + description='Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion CatalogObjectType discriminator), not by the identifier structure alone.', + examples=[['accounting', 'tax', 'paid']], + ) + + +class CatalogObjectType(RootModel[Literal['table', 'view', 'namespace']]): + root: Literal['table', 'view', 'namespace'] = Field( + ..., description='The type of a catalog object.\n' + ) + + class PrimitiveType(RootModel[str]): root: str = Field(..., examples=[['long', 'string', 'fixed[16]', 'decimal(10,2)']]) diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index 2435cd43f0e5..245007c65c36 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -2267,6 +2267,27 @@ components: type: string nullable: false + CatalogObjectIdentifier: + description: + Reference to a catalog object (table, view, or namespace) as an + ordered list of hierarchical levels. + The object kind is determined by context (e.g. the endpoint or a + companion CatalogObjectType discriminator), not by the identifier + structure alone. + type: array + items: + type: string + example: [ "accounting", "tax", "paid" ] + + CatalogObjectType: + type: string + description: | + The type of a catalog object. + enum: + - table + - view + - namespace + PrimitiveType: type: string example: From 9f16004b2392898a18a58fff0537337d221bfbbd Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Fri, 8 May 2026 10:20:12 -0700 Subject: [PATCH 2/3] OpenAPI: Drop the shared CatalogObjectType schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CatalogObjectType was introduced as a single shared discriminator for two prospective consumers — the resolve endpoint response and the events endpoint filter — but those use cases have different forward-compat profiles and will define their own narrower closed enums (RelationType near resolve, EventObjectType near events). Removing the shared schema avoids cross-coupling those evolution schedules and lets each endpoint commit only to the values it needs. Also rewords the CatalogObjectIdentifier description to no longer reference CatalogObjectType by name. Co-Authored-By: Claude Opus 4.7 (1M context) --- open-api/rest-catalog-open-api.py | 10 ++-------- open-api/rest-catalog-open-api.yaml | 12 +----------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/open-api/rest-catalog-open-api.py b/open-api/rest-catalog-open-api.py index 3a7ff8b5facb..d626f334343f 100644 --- a/open-api/rest-catalog-open-api.py +++ b/open-api/rest-catalog-open-api.py @@ -108,22 +108,16 @@ class TableIdentifier(BaseModel): class CatalogObjectIdentifier(RootModel[list[str]]): """ - Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion CatalogObjectType discriminator), not by the identifier structure alone. + Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion type discriminator), not by the identifier structure alone. """ root: list[str] = Field( ..., - description='Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion CatalogObjectType discriminator), not by the identifier structure alone.', + description='Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion type discriminator), not by the identifier structure alone.', examples=[['accounting', 'tax', 'paid']], ) -class CatalogObjectType(RootModel[Literal['table', 'view', 'namespace']]): - root: Literal['table', 'view', 'namespace'] = Field( - ..., description='The type of a catalog object.\n' - ) - - class PrimitiveType(RootModel[str]): root: str = Field(..., examples=[['long', 'string', 'fixed[16]', 'decimal(10,2)']]) diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index 245007c65c36..e679fb58540a 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -2272,22 +2272,12 @@ components: Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a - companion CatalogObjectType discriminator), not by the identifier - structure alone. + companion type discriminator), not by the identifier structure alone. type: array items: type: string example: [ "accounting", "tax", "paid" ] - CatalogObjectType: - type: string - description: | - The type of a catalog object. - enum: - - table - - view - - namespace - PrimitiveType: type: string example: From 9c2ed0a73a14ac327ddb03af44331190def3e7e0 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Fri, 15 May 2026 13:08:02 -0700 Subject: [PATCH 3/3] OpenAPI: Reword CatalogObjectIdentifier example list as non-exhaustive Adds "for example" so the listed object kinds (table, view, namespace) read as a sample rather than the complete set. Avoids needing to update the description as new kinds (functions, indexes, etc.) are added later. Co-Authored-By: Claude Opus 4.7 (1M context) --- open-api/rest-catalog-open-api.py | 4 ++-- open-api/rest-catalog-open-api.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/open-api/rest-catalog-open-api.py b/open-api/rest-catalog-open-api.py index d626f334343f..30ae491248fa 100644 --- a/open-api/rest-catalog-open-api.py +++ b/open-api/rest-catalog-open-api.py @@ -108,12 +108,12 @@ class TableIdentifier(BaseModel): class CatalogObjectIdentifier(RootModel[list[str]]): """ - Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion type discriminator), not by the identifier structure alone. + Reference to a catalog object (for example, table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion type discriminator), not by the identifier structure alone. """ root: list[str] = Field( ..., - description='Reference to a catalog object (table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion type discriminator), not by the identifier structure alone.', + description='Reference to a catalog object (for example, table, view, or namespace) as an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion type discriminator), not by the identifier structure alone.', examples=[['accounting', 'tax', 'paid']], ) diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index e679fb58540a..b2404f7424ea 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -2269,8 +2269,8 @@ components: CatalogObjectIdentifier: description: - Reference to a catalog object (table, view, or namespace) as an - ordered list of hierarchical levels. + Reference to a catalog object (for example, table, view, or namespace) as + an ordered list of hierarchical levels. The object kind is determined by context (e.g. the endpoint or a companion type discriminator), not by the identifier structure alone. type: array