From 4bc2f9e1b0c4c4de0e81e41e077471c18a80f3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Behrendt?= Date: Wed, 29 Jan 2025 14:01:30 +0100 Subject: [PATCH 1/2] fix(CLI): pass translation_key_ids when removing keys from job --- doc/compiled.json | 57 +++++++++++++++++++++---------------- paths/jobs/remove_keys.yaml | 39 ++++++++++++++----------- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index d59f471ca..f1b1c685c 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -11288,29 +11288,6 @@ }, { "$ref": "#/components/parameters/id" - }, - { - "description": "specify the branch to use", - "example": "my-feature-branch", - "name": "branch", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "description": "ids of keys that should be removed from the job", - "example": [ - "abcd1234cdef1234abcd1234cdef1234" - ], - "name": "translation_key_ids", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } } ], "responses": { @@ -11334,10 +11311,40 @@ }, { "lang": "CLI v2", - "source": "phrase jobs keys_delete \\\n--project_id \\\n--id \\\n--branch my-feature-branch \\\n--translation_key_ids \"abcd1234cdef1234abcd1234cdef1234\" \\\n--access_token " + "source": "phrase jobs keys_delete \\\n--project_id \\\n--id \\\n--branch my-feature-branch \\\n--data '{\"branch\": \"my-feature-branch\", \"translation_key_ids\": [\"abcd1234cdef1234abcd1234cdef1234\"]}' \\\n--access_token " } ], - "x-cli-version": "2.5" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "job/keys/delete/parameters", + "required": [ + "name" + ], + "properties": { + "branch": { + "description": "specify the branch to use", + "type": "string", + "example": "my-feature-branch" + }, + "translation_key_ids": { + "description": "ids of keys that should be deleted from the job", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "abcd1234cdef1234abcd1234cdef1234" + ] + } + } + } + } + } + } } }, "/projects/{project_id}/job_templates": { diff --git a/paths/jobs/remove_keys.yaml b/paths/jobs/remove_keys.yaml index d73da73e4..847d02277 100644 --- a/paths/jobs/remove_keys.yaml +++ b/paths/jobs/remove_keys.yaml @@ -8,21 +8,6 @@ parameters: - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" - "$ref": "../../parameters.yaml#/project_id" - "$ref": "../../parameters.yaml#/id" -- description: specify the branch to use - example: my-feature-branch - name: branch - in: query - schema: - type: string -- description: ids of keys that should be removed from the job - example: - - abcd1234cdef1234abcd1234cdef1234 - name: translation_key_ids - in: query - schema: - type: array - items: - type: string responses: '204': "$ref": "../../responses.yaml#/204" @@ -46,6 +31,26 @@ x-code-samples: --project_id \ --id \ --branch my-feature-branch \ - --translation_key_ids "abcd1234cdef1234abcd1234cdef1234" \ + --data '{"branch": "my-feature-branch", "translation_key_ids": ["abcd1234cdef1234abcd1234cdef1234"]}' \ --access_token -x-cli-version: '2.5' +requestBody: + required: true + content: + application/json: + schema: + type: object + title: job/keys/delete/parameters + required: + - name + properties: + branch: + description: specify the branch to use + type: string + example: my-feature-branch + translation_key_ids: + description: ids of keys that should be deleted from the job + type: array + items: + type: string + example: + - abcd1234cdef1234abcd1234cdef1234 From 1031d8208a2b26bd6504f1606f783159149d3c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Behrendt?= Date: Wed, 29 Jan 2025 14:41:14 +0100 Subject: [PATCH 2/2] Set translation_key_ids as required --- doc/compiled.json | 2 +- paths/jobs/remove_keys.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index f1b1c685c..0cb78d3e7 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -11322,7 +11322,7 @@ "type": "object", "title": "job/keys/delete/parameters", "required": [ - "name" + "translation_key_ids" ], "properties": { "branch": { diff --git a/paths/jobs/remove_keys.yaml b/paths/jobs/remove_keys.yaml index 847d02277..b6fb18ffc 100644 --- a/paths/jobs/remove_keys.yaml +++ b/paths/jobs/remove_keys.yaml @@ -41,7 +41,7 @@ requestBody: type: object title: job/keys/delete/parameters required: - - name + - translation_key_ids properties: branch: description: specify the branch to use