From 7805e90af241378d36135ba9f7db45184506a2e1 Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Mon, 21 Feb 2022 17:57:20 -0800 Subject: [PATCH 1/3] SPEC - Update REST Catalog spec to put types and examples on catalog config --- open-api/rest-catalog-open-api.yaml | 60 ++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index c0375570209c..1e7774c60f7f 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -73,9 +73,9 @@ paths: properties from the server to configure the catalog and its HTTP client. Configuration from the server consists of two sets of key/value pairs. - - defaults - properties that should be used as default configuration; applied before client configuration + * defaults - properties that should be used as default configuration; applied before client configuration - - overrides - properties that should be used to override client configuration; applied after defaults and client configuration + * overrides - properties that should be used to override client configuration; applied after defaults and client configuration Catalog configuration is constructed by setting the defaults, then client- @@ -94,21 +94,7 @@ paths: " responses: 200: - description: Server specified configuration values. - content: - application/json: - schema: - $ref: '#/components/schemas/CatalogConfiguration' - example: { - "data": { - "overrides": { - "warehouse": "s3://bucket/warehouse/" - }, - "defaults": { - "clients": "4" - } - } - } + $ref: '#/components/responses/RESTCatalogConfigResponse' 400: $ref: '#/components/responses/BadRequestErrorResponse' 401: @@ -757,7 +743,7 @@ components: items: type: string - CatalogConfiguration: + RESTCatalogConfig: type: object description: Server-provided configuration for the catalog. required: @@ -766,12 +752,22 @@ components: properties: overrides: type: object + uniqueItems: true + additionalProperties: + type: string description: Properties that should be used to override client configuration; applied after defaults and client configuration. + example: { "warehouse": "s3://bucket/warehouse" } + default: { } defaults: type: object + uniqueItems: true + additionalProperties: + type: string description: Properties that should be used as default configuration; applied before client configuration. + example: { "clients": "4" } + default: { } CreateNamespaceRequest: type: object @@ -1441,6 +1437,34 @@ components: ############################# responses: + RESTCatalogConfigResponse: + description: + Configuration from the server consists of two sets of key/value pairs. + * defaults - properties that should be used as default configuration; applied before client configuration + * overrides - properties that should be used to override client configuration; applied after defaults and + client configuration + The REST Catalog configuration is constructed by setting the defaults, then client- + provided configuration, and finally overrides. The resulting final property set is then + used to configure the catalog. + + For example, a default configuration property might set the size of the + client pool, which can be replaced with a client-specific setting. An + override might be used to set the warehouse location, which is stored + on the server rather than in client configuration. + content: + application/json: + schema: + $ref: '#/components/schemas/RESTCatalogConfig' + example: { + "defaults": { + "clients": "4" + }, + "overrides": { + "warehouse": "s3://bucket/warehouse/" + } + } + + BadRequestErrorResponse: description: Indicates a bad request error. It could be caused by an unexpected request From ce7e6c24c7bd2994e85be00805d1180146bf511a Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Mon, 21 Feb 2022 21:39:19 -0800 Subject: [PATCH 2/3] Rever unnecessary changes to config route description for now --- open-api/rest-catalog-open-api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index 1e7774c60f7f..68534805d3c5 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -73,9 +73,9 @@ paths: properties from the server to configure the catalog and its HTTP client. Configuration from the server consists of two sets of key/value pairs. - * defaults - properties that should be used as default configuration; applied before client configuration + - defaults - properties that should be used as default configuration; applied before client configuration - * overrides - properties that should be used to override client configuration; applied after defaults and client configuration + - overrides - properties that should be used to override client configuration; applied after defaults and client configuration Catalog configuration is constructed by setting the defaults, then client- From 838bb2bd20b7395819b9d8a930b87d2ba98e058d Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Mon, 4 Apr 2022 15:39:55 -0700 Subject: [PATCH 3/3] Update to remove uniqueItems from maps --- open-api/rest-catalog-open-api.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml index 68534805d3c5..bbd7b18185f8 100644 --- a/open-api/rest-catalog-open-api.yaml +++ b/open-api/rest-catalog-open-api.yaml @@ -752,8 +752,7 @@ components: properties: overrides: type: object - uniqueItems: true - additionalProperties: + items: type: string description: Properties that should be used to override client configuration; applied after defaults and client configuration. @@ -761,8 +760,7 @@ components: default: { } defaults: type: object - uniqueItems: true - additionalProperties: + items: type: string description: Properties that should be used as default configuration; applied before client configuration.