Skip to content

Commit eaef2c6

Browse files
committed
add versioning info
1 parent 860d73a commit eaef2c6

File tree

2 files changed

+59
-17
lines changed

2 files changed

+59
-17
lines changed

open-api/rest-catalog-open-api.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,25 @@ class ErrorModel(BaseModel):
4141
stack: Optional[List[str]] = None
4242

4343

44+
class ServerCapability(BaseModel):
45+
"""
46+
Describes a capability with versioning information supported by the server. A server is required to implement all endpoints grouped under a particular capability. For example, if a server reports the support of `views`, then all endpoints grouped under the `views` capability must be implemented by the server.
47+
"""
48+
49+
capability: str = Field(
50+
...,
51+
description='A capability supported by the server. The currently available capabilities are:\n - tables\n - views\n - remote-signing\n - multi-table-commit\n - register-table\n - table-metrics\n',
52+
example='views',
53+
)
54+
versions: List[int] = Field(
55+
...,
56+
description='A list of versions supported by the server for the given capability. For example, `versions = [1, 3, 5]` indicates that only these versions are supported for the given capability, but not versions `2, 4, 6`.',
57+
example=[1, 3, 5],
58+
min_items=1,
59+
unique_items=True,
60+
)
61+
62+
4463
class CatalogConfig(BaseModel):
4564
"""
4665
Server-provided configuration for the catalog.
@@ -54,19 +73,14 @@ class CatalogConfig(BaseModel):
5473
...,
5574
description='Properties that should be used as default configuration; applied before client configuration.',
5675
)
57-
capabilities: Optional[List[str]] = Field(
76+
capabilities: Optional[List[ServerCapability]] = Field(
5877
None,
59-
description='Describes capabilities supported by the server. A server is required to implement all endpoints grouped under a particular capability. For example, if a server reports the support of `views`, then all endpoints grouped under the `views` capability must be implemented by the server.',
78+
description='Describes a capability with versioning information supported by the server',
6079
example=[
61-
'tables',
62-
'views',
63-
'remote-signing',
64-
'vended-credentials',
65-
'multi-table-commit',
66-
'register-table',
67-
'table-metrics',
80+
{'capability': 'views', 'versions': [1, 2]},
81+
{'capability': 'register-table', 'versions': [1, 3, 5]},
82+
{'capability': 'multi-table-commit', 'versions': [1]},
6883
],
69-
unique_items=True,
7084
)
7185

7286

open-api/rest-catalog-open-api.yaml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ paths:
143143
"defaults": {
144144
"clients": "4"
145145
},
146-
"capabilities": ["tables", "views", "remote-signing"]
146+
"capabilities": [{"capability": "views", "versions": [1, 2]},
147+
{"capability": "register-table", "versions": [1, 3, 5]},
148+
{"capability": "multi-table-commit", "versions":[1]}]
147149
}
148150
400:
149151
$ref: '#/components/responses/BadRequestErrorResponse'
@@ -1581,6 +1583,35 @@ components:
15811583
items:
15821584
type: string
15831585

1586+
ServerCapability:
1587+
type: object
1588+
description: Describes a capability with versioning information supported by the server. A server is required to implement all endpoints grouped under a particular capability.
1589+
For example, if a server reports the support of `views`, then all endpoints grouped under the `views` capability must be implemented by the server.
1590+
required:
1591+
- capability
1592+
- versions
1593+
properties:
1594+
capability:
1595+
type: string
1596+
description: |
1597+
A capability supported by the server. The currently available capabilities are:
1598+
- tables
1599+
- views
1600+
- remote-signing
1601+
- multi-table-commit
1602+
- register-table
1603+
- table-metrics
1604+
example: "views"
1605+
versions:
1606+
type: array
1607+
uniqueItems: true
1608+
description: A list of versions supported by the server for the given capability. For example, `versions = [1, 3, 5]` indicates that only
1609+
these versions are supported for the given capability, but not versions `2, 4, 6`.
1610+
items:
1611+
type: integer
1612+
minItems: 1
1613+
example: [1, 3, 5]
1614+
15841615
CatalogConfig:
15851616
type: object
15861617
description: Server-provided configuration for the catalog.
@@ -1602,13 +1633,10 @@ components:
16021633
Properties that should be used as default configuration; applied before client configuration.
16031634
capabilities:
16041635
type: array
1605-
uniqueItems: true
16061636
items:
1607-
type: string
1608-
description:
1609-
Describes capabilities supported by the server. A server is required to implement all endpoints grouped under a particular capability.
1610-
For example, if a server reports the support of `views`, then all endpoints grouped under the `views` capability must be implemented by the server.
1611-
example: [ "tables", "views", "remote-signing", "vended-credentials", "multi-table-commit", "register-table", "table-metrics" ]
1637+
$ref: '#/components/schemas/ServerCapability'
1638+
description: Describes a capability with versioning information supported by the server
1639+
example: [{"capability": "views", "versions": [1, 2]}, {"capability": "register-table", "versions": [1, 3, 5]}, {"capability": "multi-table-commit","versions":[1]}]
16121640

16131641
CreateNamespaceRequest:
16141642
type: object

0 commit comments

Comments
 (0)