From 714f3e65b2b882304272fcadfffcc65c4254b147 Mon Sep 17 00:00:00 2001 From: Michael Blum Date: Wed, 3 Dec 2025 09:41:24 +0100 Subject: [PATCH 1/2] feat(API): add pr_branch param to repo-sync export #SCD-594 --- doc/compiled.json | 17 +++++++++++++++-- parameters.yaml | 8 ++++++++ paths/repo_syncs/export.yaml | 4 +++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index e9c0293d9..40ee71219 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -4961,6 +4961,16 @@ }, "example": "my-feature-branch" }, + "pr_branch": { + "name": "pr_branch", + "in": "query", + "description": "Source branch to open a pull request from", + "required": false, + "schema": { + "type": "string" + }, + "example": "my-feature-branch" + }, "page": { "in": "query", "name": "page", @@ -22891,6 +22901,9 @@ }, { "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/pr_branch" } ], "responses": { @@ -22928,11 +22941,11 @@ "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'" + "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export?pr_branch=my-feature-branch\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json'" }, { "lang": "CLI v2", - "source": "phrase repo_syncs export \\\n--id \\\n--access_token " + "source": "phrase repo_syncs export \\\n--id \\\n--pr_branch my-feature-branch \\\n--access_token " } ], "x-cli-version": "2.24" diff --git a/parameters.yaml b/parameters.yaml index c9cf0eed6..2fd4dbb3e 100644 --- a/parameters.yaml +++ b/parameters.yaml @@ -214,6 +214,14 @@ branch: schema: type: string example: my-feature-branch +pr_branch: + name: pr_branch + in: query + description: Source branch to open a pull request from + required: false + schema: + type: string + example: my-feature-branch page: in: query name: page diff --git a/paths/repo_syncs/export.yaml b/paths/repo_syncs/export.yaml index 18be769c6..b9d6493b3 100644 --- a/paths/repo_syncs/export.yaml +++ b/paths/repo_syncs/export.yaml @@ -12,6 +12,7 @@ parameters: - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" - "$ref": "../../parameters.yaml#/account_id" - "$ref": "../../parameters.yaml#/id" +- "$ref": "../../parameters.yaml#/pr_branch" responses: '200': description: OK @@ -35,7 +36,7 @@ responses: x-code-samples: - lang: Curl source: |- - curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export"\ + curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export?pr_branch=my-feature-branch"\ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -H 'Content-Type: application/json' @@ -43,5 +44,6 @@ x-code-samples: source: |- phrase repo_syncs export \ --id \ + --pr_branch my-feature-branch \ --access_token x-cli-version: '2.24' From 39e494341845f930b7f5614013efacd726291943 Mon Sep 17 00:00:00 2001 From: Michael Blum Date: Fri, 6 Feb 2026 13:45:58 +0100 Subject: [PATCH 2/2] Move to requestBody --- doc/compiled.json | 33 +++++++++++++++++++-------------- parameters.yaml | 8 -------- paths/repo_syncs/export.yaml | 18 +++++++++++++++--- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index 40ee71219..898a44a38 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -4961,16 +4961,6 @@ }, "example": "my-feature-branch" }, - "pr_branch": { - "name": "pr_branch", - "in": "query", - "description": "Source branch to open a pull request from", - "required": false, - "schema": { - "type": "string" - }, - "example": "my-feature-branch" - }, "page": { "in": "query", "name": "page", @@ -22901,11 +22891,26 @@ }, { "$ref": "#/components/parameters/id" - }, - { - "$ref": "#/components/parameters/pr_branch" } ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "repo_sync/export/parameters", + "properties": { + "pr_branch": { + "description": "Source branch to open a pull request from", + "type": "string", + "example": "my-feature-branch" + } + } + } + } + } + }, "responses": { "200": { "description": "OK", @@ -22941,7 +22946,7 @@ "x-code-samples": [ { "lang": "Curl", - "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export?pr_branch=my-feature-branch\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json'" + "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\"}'" }, { "lang": "CLI v2", diff --git a/parameters.yaml b/parameters.yaml index 2fd4dbb3e..c9cf0eed6 100644 --- a/parameters.yaml +++ b/parameters.yaml @@ -214,14 +214,6 @@ branch: schema: type: string example: my-feature-branch -pr_branch: - name: pr_branch - in: query - description: Source branch to open a pull request from - required: false - schema: - type: string - example: my-feature-branch page: in: query name: page diff --git a/paths/repo_syncs/export.yaml b/paths/repo_syncs/export.yaml index b9d6493b3..88c348a86 100644 --- a/paths/repo_syncs/export.yaml +++ b/paths/repo_syncs/export.yaml @@ -12,7 +12,18 @@ parameters: - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" - "$ref": "../../parameters.yaml#/account_id" - "$ref": "../../parameters.yaml#/id" -- "$ref": "../../parameters.yaml#/pr_branch" +requestBody: + required: false + content: + application/json: + schema: + type: object + title: repo_sync/export/parameters + properties: + pr_branch: + description: Source branch to open a pull request from + type: string + example: my-feature-branch responses: '200': description: OK @@ -36,10 +47,11 @@ responses: x-code-samples: - lang: Curl source: |- - curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export?pr_branch=my-feature-branch"\ + curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export" \ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ - -H 'Content-Type: application/json' + -H 'Content-Type: application/json' \ + -d '{"pr_branch":"my-feature-branch"}' - lang: CLI v2 source: |- phrase repo_syncs export \