Skip to content

Commit

Permalink
OpenAPI: Add AssignUUID update to metadata updates (#8716)
Browse files Browse the repository at this point in the history
  • Loading branch information
nastra authored Oct 5, 2023
1 parent a960d43 commit dd26f36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions open-api/rest-catalog-open-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class MetadataLog(BaseModel):

class BaseUpdate(BaseModel):
action: Literal[
'assign-uuid',
'upgrade-format-version',
'add-schema',
'set-current-schema',
Expand All @@ -228,6 +229,10 @@ class BaseUpdate(BaseModel):
]


class AssignUUIDUpdate(BaseUpdate):
uuid: str


class UpgradeFormatVersionUpdate(BaseUpdate):
format_version: int = Field(..., alias='format-version')

Expand Down Expand Up @@ -632,6 +637,7 @@ class AddSchemaUpdate(BaseUpdate):

class TableUpdate(BaseModel):
__root__: Union[
AssignUUIDUpdate,
UpgradeFormatVersionUpdate,
AddSchemaUpdate,
SetCurrentSchemaUpdate,
Expand Down
12 changes: 12 additions & 0 deletions open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,7 @@ components:
action:
type: string
enum:
- assign-uuid
- upgrade-format-version
- add-schema
- set-current-schema
Expand All @@ -1695,6 +1696,16 @@ components:
- set-properties
- remove-properties

AssignUUIDUpdate:

This comment has been minimized.

Copy link
@rdblue

rdblue Oct 5, 2023

Contributor

@nastra, I think that this needs additional context. I don't think it is safe to reassign a UUID for a table that already has one.

This comment has been minimized.

Copy link
@nastra

nastra Oct 9, 2023

Author Contributor

I've opened #8753 to add a description

allOf:
- $ref: '#/components/schemas/BaseUpdate'
- type: object
required:
- uuid
properties:
uuid:
type: string

UpgradeFormatVersionUpdate:
allOf:
- $ref: '#/components/schemas/BaseUpdate'
Expand Down Expand Up @@ -1851,6 +1862,7 @@ components:

TableUpdate:
anyOf:
- $ref: '#/components/schemas/AssignUUIDUpdate'
- $ref: '#/components/schemas/UpgradeFormatVersionUpdate'
- $ref: '#/components/schemas/AddSchemaUpdate'
- $ref: '#/components/schemas/SetCurrentSchemaUpdate'
Expand Down

0 comments on commit dd26f36

Please sign in to comment.