From 47b84917617eee87cb41eb850cafc58de24cfbfc Mon Sep 17 00:00:00 2001 From: Mladen Jablanovic Date: Thu, 12 Feb 2026 14:52:41 +0100 Subject: [PATCH] feat(API): RepoSync export: optional branch parameter --- doc/compiled.json | 63 +++++++++++++++++++----------------- paths/repo_syncs/export.yaml | 9 ++++-- paths/repo_syncs/import.yaml | 34 ++++++++++--------- 3 files changed, 58 insertions(+), 48 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index a490b9ad..dee9216f 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -22910,6 +22910,11 @@ "description": "Source branch to open a pull request from", "type": "string", "example": "my-feature-branch" + }, + "branch": { + "description": "Strings branch to export from", + "type": "string", + "example": "my-strings-branch" } } } @@ -22951,14 +22956,13 @@ "x-code-samples": [ { "lang": "Curl", - "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json' \\\n -d '{\"pr_branch\":\"my-feature-branch\"}'" + "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json' \\\n -d '{\"pr_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}'" }, { "lang": "CLI v2", - "source": "phrase repo_syncs export \\\n--id \\\n--pr_branch my-feature-branch \\\n--access_token " + "source": "phrase repo_syncs export \\\n--id \\\n--data '{\"pr_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}' \\\n--access_token " } - ], - "x-cli-version": "2.24" + ] } }, "/accounts/{account_id}/repo_syncs/{id}/import": { @@ -22978,11 +22982,31 @@ }, { "$ref": "#/components/parameters/id" - }, - { - "$ref": "#/components/parameters/branch" } ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "repo_sync/import/parameters", + "properties": { + "repository_branch": { + "description": "Branch to import from", + "type": "string", + "example": "my-feature-branch" + }, + "branch": { + "description": "Strings branch to import to", + "type": "string", + "example": "my-strings-branch" + } + } + } + } + } + }, "responses": { "200": { "description": "OK", @@ -23018,32 +23042,13 @@ "x-code-samples": [ { "lang": "Curl", - "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"repository_branch\":\"my-feature-branch\"}' \\\n -H 'Content-Type: application/json'" + "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"repository_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}' \\\n -H 'Content-Type: application/json'" }, { "lang": "CLI v2", - "source": "phrase repo_syncs import \\\n--id \\\n--data '{\"repository_branch\":\"my-feature-branch\"}' \\\n--access_token " + "source": "phrase repo_syncs import \\\n--id \\\n--data '{\"repository_branch\":\"my-feature-branch\", \"branch\":\"my-strings-branch\"}' \\\n--access_token " } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "repo_sync/import/parameters", - "properties": { - "repository_branch": { - "description": "Branch to import from", - "type": "string", - "example": "my-feature-branch" - } - } - } - } - } - }, - "x-cli-version": "2.24" + ] } }, "/accounts/{account_id}/repo_syncs/{id}/events": { diff --git a/paths/repo_syncs/export.yaml b/paths/repo_syncs/export.yaml index 88c348a8..0f07fcea 100644 --- a/paths/repo_syncs/export.yaml +++ b/paths/repo_syncs/export.yaml @@ -24,6 +24,10 @@ requestBody: description: Source branch to open a pull request from type: string example: my-feature-branch + branch: + description: Strings branch to export from + type: string + example: my-strings-branch responses: '200': description: OK @@ -51,11 +55,10 @@ x-code-samples: -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -H 'Content-Type: application/json' \ - -d '{"pr_branch":"my-feature-branch"}' + -d '{"pr_branch":"my-feature-branch", "branch":"my-strings-branch"}' - lang: CLI v2 source: |- phrase repo_syncs export \ --id \ - --pr_branch my-feature-branch \ + --data '{"pr_branch":"my-feature-branch", "branch":"my-strings-branch"}' \ --access_token -x-cli-version: '2.24' diff --git a/paths/repo_syncs/import.yaml b/paths/repo_syncs/import.yaml index d8e5f8c2..fc0d9310 100644 --- a/paths/repo_syncs/import.yaml +++ b/paths/repo_syncs/import.yaml @@ -12,7 +12,22 @@ parameters: - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" - "$ref": "../../parameters.yaml#/account_id" - "$ref": "../../parameters.yaml#/id" -- "$ref": "../../parameters.yaml#/branch" +requestBody: + required: false + content: + application/json: + schema: + type: object + title: repo_sync/import/parameters + properties: + repository_branch: + description: Branch to import from + type: string + example: my-feature-branch + branch: + description: Strings branch to import to + type: string + example: my-strings-branch responses: '200': description: OK @@ -39,24 +54,11 @@ x-code-samples: curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import"\ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ - -d '{"repository_branch":"my-feature-branch"}' \ + -d '{"repository_branch":"my-feature-branch", "branch":"my-strings-branch"}' \ -H 'Content-Type: application/json' - lang: CLI v2 source: |- phrase repo_syncs import \ --id \ - --data '{"repository_branch":"my-feature-branch"}' \ + --data '{"repository_branch":"my-feature-branch", "branch":"my-strings-branch"}' \ --access_token -requestBody: - required: false - content: - application/json: - schema: - type: object - title: repo_sync/import/parameters - properties: - repository_branch: - description: Branch to import from - type: string - example: my-feature-branch -x-cli-version: '2.24'