From b2a596fe4b6ef1101772ae23b5703240b0adeaa3 Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Wed, 8 Jan 2025 12:36:41 -0500 Subject: [PATCH] Dedup Spaces key model --- specification/resources/spaces/key_create.yml | 2 +- specification/resources/spaces/key_patch.yml | 2 +- specification/resources/spaces/key_update.yml | 2 +- .../models/{key_response.yml => key.yml} | 6 --- .../spaces/models/key_create_response.yml | 49 ++++--------------- .../resources/spaces/models/key_request.yml | 14 ------ .../resources/spaces/responses/key_list.yml | 2 +- .../resources/spaces/responses/key_update.yml | 2 +- 8 files changed, 15 insertions(+), 64 deletions(-) rename specification/resources/spaces/models/{key_response.yml => key.yml} (91%) delete mode 100644 specification/resources/spaces/models/key_request.yml diff --git a/specification/resources/spaces/key_create.yml b/specification/resources/spaces/key_create.yml index d7810a96..c13a52f0 100644 --- a/specification/resources/spaces/key_create.yml +++ b/specification/resources/spaces/key_create.yml @@ -14,7 +14,7 @@ requestBody: content: application/json: schema: - $ref: 'models/key_request.yml' + $ref: 'models/key.yml' examples: Read Only Key: diff --git a/specification/resources/spaces/key_patch.yml b/specification/resources/spaces/key_patch.yml index d28cbc1b..b654aac8 100644 --- a/specification/resources/spaces/key_patch.yml +++ b/specification/resources/spaces/key_patch.yml @@ -17,7 +17,7 @@ requestBody: content: application/json: schema: - $ref: 'models/key_request.yml' + $ref: 'models/key.yml' responses: '200': diff --git a/specification/resources/spaces/key_update.yml b/specification/resources/spaces/key_update.yml index 1ba7ece5..aec26d7e 100644 --- a/specification/resources/spaces/key_update.yml +++ b/specification/resources/spaces/key_update.yml @@ -17,7 +17,7 @@ requestBody: content: application/json: schema: - $ref: 'models/key_request.yml' + $ref: 'models/key.yml' responses: '200': diff --git a/specification/resources/spaces/models/key_response.yml b/specification/resources/spaces/models/key.yml similarity index 91% rename from specification/resources/spaces/models/key_response.yml rename to specification/resources/spaces/models/key.yml index ffe40e18..6648a404 100644 --- a/specification/resources/spaces/models/key_response.yml +++ b/specification/resources/spaces/models/key.yml @@ -25,9 +25,3 @@ properties: description: The date and time the key was created. example: '2018-07-19T15:04:16Z' readOnly: true - -required: -- name -- grants -- access_key -- created_at diff --git a/specification/resources/spaces/models/key_create_response.yml b/specification/resources/spaces/models/key_create_response.yml index 0f7338fd..5d7c7a92 100644 --- a/specification/resources/spaces/models/key_create_response.yml +++ b/specification/resources/spaces/models/key_create_response.yml @@ -1,39 +1,10 @@ -type: object - -properties: - name: - type: string - description: The name of your access key. - example: "my-access-key" - - grants: - type: array - description: The grants set to this access key. - items: - $ref: 'grant.yml' - default: [] - - access_key: - type: string - description: The access key. - example: DOACCESSKEYEXAMPLE - readOnly: true - - secret_key: - type: string - description: The secret key. - example: DOSECRETKEYEXAMPLE - - created_at: - type: string - format: date-time - description: The date and time the key was created. - example: '2018-07-19T15:04:16Z' - readOnly: true - -required: -- name -- grants -- access_key -- secret_key -- created_at +allOf: + - type: object + properties: + secret_key: + type: string + description: The secret key. This is the only time the secret key will be returned. + example: DOSECRETKEYEXAMPLE + readOnly: true + + - $ref: 'key.yml' \ No newline at end of file diff --git a/specification/resources/spaces/models/key_request.yml b/specification/resources/spaces/models/key_request.yml deleted file mode 100644 index 449db4d9..00000000 --- a/specification/resources/spaces/models/key_request.yml +++ /dev/null @@ -1,14 +0,0 @@ -type: object - -properties: - name: - type: string - description: The name of your access key. - example: "my-access-key" - - grants: - type: array - description: The grants to set to this access key. - items: - $ref: 'grant.yml' - default: [] diff --git a/specification/resources/spaces/responses/key_list.yml b/specification/resources/spaces/responses/key_list.yml index a7017398..d9c2b385 100644 --- a/specification/resources/spaces/responses/key_list.yml +++ b/specification/resources/spaces/responses/key_list.yml @@ -18,7 +18,7 @@ content: keys: type: array items: - $ref: '../models/key_response.yml' + $ref: '../models/key.yml' - $ref: '../../../shared/pages.yml#/pagination' - $ref: '../../../shared/meta.yml' diff --git a/specification/resources/spaces/responses/key_update.yml b/specification/resources/spaces/responses/key_update.yml index fcc1d10d..f03f978d 100644 --- a/specification/resources/spaces/responses/key_update.yml +++ b/specification/resources/spaces/responses/key_update.yml @@ -12,7 +12,7 @@ headers: content: application/json: schema: - $ref: '../models/key_response.yml' + $ref: '../models/key.yml' examples: Read Only Key: