Skip to content

Commit

Permalink
Core: Document prefix in REST catalog spec (#5233)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko authored Jul 10, 2022
1 parent 0f13b2a commit f281ec0
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 13 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/open-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: "Open-API"
on:
push:
branches:
- 'master'
- '0.**'
tags:
- 'apache-iceberg-**'
pull_request:
paths:
- '.github/workflows/open-api.yml'
- 'open-api/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
tox:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install
working-directory: ./open-api
run: pip install openapi-spec-validator && openapi-spec-validator rest-catalog-open-api.yaml
42 changes: 29 additions & 13 deletions open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'

/v1/namespaces:
/v1/{prefix}/namespaces:
parameters:
- $ref: '#/components/parameters/prefix'

get:
tags:
Expand Down Expand Up @@ -268,8 +270,9 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'

/v1/namespaces/{namespace}:
/v1/{prefix}/namespaces/{namespace}:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'

get:
Expand Down Expand Up @@ -333,8 +336,9 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'

/v1/namespaces/{namespace}/properties:
/v1/{prefix}/namespaces/{namespace}/properties:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'

post:
Expand Down Expand Up @@ -394,8 +398,9 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'

/v1/namespaces/{namespace}/tables:
/v1/{prefix}/namespaces/{namespace}/tables:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'

get:
Expand Down Expand Up @@ -486,8 +491,9 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'

/v1/namespaces/{namespace}/tables/{table}:
/v1/{prefix}/namespaces/{namespace}/tables/{table}:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
- $ref: '#/components/parameters/table'

Expand Down Expand Up @@ -702,7 +708,9 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'

/v1/tables/rename:
/v1/{prefix}/tables/rename:
parameters:
- $ref: '#/components/parameters/prefix'

post:
tags:
Expand Down Expand Up @@ -782,6 +790,14 @@ components:
multipart_namespace:
value: "accounting%1Ftax"

prefix:
name: prefix
in: path
schema:
type: string
required: true
description: An optional prefix in the path

table:
name: table
in: path
Expand Down Expand Up @@ -1415,19 +1431,19 @@ components:
Assertions from the client that must be valid for the commit to succeed. Assertions are identified by `type` -

- `assert-create` - the table must not already exist; used for create transactions

- `assert-table-uuid` - the table UUID must match the requirement's `uuid`

- `assert-ref-snapshot-id` - the table branch or tag identified by the requirement's `ref` must reference the requirement's `snapshot-id`; if `snapshot-id` is `null` or missing, the ref must not already exist

- `assert-last-assigned-field-id` - the table's last assigned column id must match the requirement's `last-assigned-field-id`

- `assert-current-schema-id` - the table's current schema id must match the requirement's `current-schema-id`

- `assert-last-assigned-partition-id` - the table's last assigned partition id must match the requirement's `last-assigned-partition-id`

- `assert-default-spec-id` - the table's default spec id must match the requirement's `default-spec-id`

- `assert-default-sort-order-id` - the table's default sort order id must match the requirement's `default-sort-order-id`
type: object
required:
Expand Down Expand Up @@ -1906,7 +1922,7 @@ components:
- removed
properties:
updated:
description: List of property keys that were added or udpated
description: List of property keys that were added or updated
type: array
uniqueItems: true
items:
Expand Down

0 comments on commit f281ec0

Please sign in to comment.