Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update translation key create/update with custom metadata. Add CM schema in translation key response #480

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -19897,11 +19897,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png"
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png\n -F custom_metadata[property]=value"
},
{
"lang": "CLI v2",
"source": "phrase keys create \\\n--project_id <project_id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\"}' \\\n--access_token <token>"
"source": "phrase keys create \\\n--project_id <project_id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\", \"custom_metadata\": {\"property\" => \"value\"}}' \\\n--access_token <token>"
}
],
"requestBody": {
Expand Down Expand Up @@ -19994,6 +19994,14 @@
"description": "NSStringLocalizedFormatKey attribute. Used in .stringsdict format.",
"type": "string",
"example": null
},
"custom_metadata": {
"description": "Custom metadata property name and value pairs to be associated with key.",
"type": "object",
"example": {
"fruit": "Apple",
"vegetable": "Tomato"
}
}
}
}
Expand Down Expand Up @@ -20322,11 +20330,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X PATCH \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png"
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:id\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X PATCH \\\n -F branch=my-feature-branch \\\n -F name=home.index.headline \\\n -F description=Some%20description%20worth%20knowing... \\\n -F name_plural=home.index.headlines \\\n -F data_type=number \\\n -F tags=awesome-feature,needs-proofreading \\\n -F max_characters_allowed=140 \\\n -F screenshot=@/path/to/my/screenshot.png\n -F custom_metadata[property]=value"
},
{
"lang": "CLI v2",
"source": "phrase keys update \\\n--project_id <project_id> \\\n--id <id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\"}' \\\n--access_token <token>"
"source": "phrase keys update \\\n--project_id <project_id> \\\n--id <id> \\\n--data '{\"branch\":\"my-feature-branch\", \"name\":\"home.index.headline\", \"description\": \"Some description worth knowing...\", \"name_plural\":\"home.index.headlines\", \"data_type\":\"number\", \"tags\":\"awesome-feature,needs-proofreading\", \"max_characters_allowed\":\"140\", \"screenshot\":\"/path/to/my/screenshot.png\", \"custom_metadata\": {\"property\" => \"value\"}}' \\\n--access_token <token>"
}
],
"requestBody": {
Expand Down Expand Up @@ -20414,6 +20422,14 @@
"description": "NSStringLocalizedFormatKey attribute. Used in .stringsdict format.",
"type": "string",
"example": null
},
"custom_metadata": {
"description": "Custom metadata property name and value pairs to be associated with key.",
"type": "object",
"example": {
"fruit": "Apple",
"vegetable": "Tomato"
}
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion paths/keys/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ x-code-samples:
-F tags=awesome-feature,needs-proofreading \
-F max_characters_allowed=140 \
-F screenshot=@/path/to/my/screenshot.png
-F custom_metadata[property]=value
- lang: CLI v2
source: |-
phrase keys create \
--project_id <project_id> \
--data '{"branch":"my-feature-branch", "name":"home.index.headline", "description": "Some description worth knowing...", "name_plural":"home.index.headlines", "data_type":"number", "tags":"awesome-feature,needs-proofreading", "max_characters_allowed":"140", "screenshot":"/path/to/my/screenshot.png"}' \
--data '{"branch":"my-feature-branch", "name":"home.index.headline", "description": "Some description worth knowing...", "name_plural":"home.index.headlines", "data_type":"number", "tags":"awesome-feature,needs-proofreading", "max_characters_allowed":"140", "screenshot":"/path/to/my/screenshot.png", "custom_metadata": {"property" => "value"}}' \
--access_token <token>
requestBody:
required: true
Expand Down Expand Up @@ -122,4 +123,11 @@ requestBody:
description: NSStringLocalizedFormatKey attribute. Used in .stringsdict format.
type: string
example:
custom_metadata:
description: Custom metadata property name and value pairs to be associated with key.
type: object
example:
fruit: Apple
vegetable: Tomato

x-cli-version: '2.5'
9 changes: 8 additions & 1 deletion paths/keys/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ x-code-samples:
-F tags=awesome-feature,needs-proofreading \
-F max_characters_allowed=140 \
-F screenshot=@/path/to/my/screenshot.png
-F custom_metadata[property]=value
- lang: CLI v2
source: |-
phrase keys update \
--project_id <project_id> \
--id <id> \
--data '{"branch":"my-feature-branch", "name":"home.index.headline", "description": "Some description worth knowing...", "name_plural":"home.index.headlines", "data_type":"number", "tags":"awesome-feature,needs-proofreading", "max_characters_allowed":"140", "screenshot":"/path/to/my/screenshot.png"}' \
--data '{"branch":"my-feature-branch", "name":"home.index.headline", "description": "Some description worth knowing...", "name_plural":"home.index.headlines", "data_type":"number", "tags":"awesome-feature,needs-proofreading", "max_characters_allowed":"140", "screenshot":"/path/to/my/screenshot.png", "custom_metadata": {"property" => "value"}}' \
--access_token <token>
requestBody:
required: true
Expand Down Expand Up @@ -120,4 +121,10 @@ requestBody:
description: NSStringLocalizedFormatKey attribute. Used in .stringsdict format.
type: string
example:
custom_metadata:
description: Custom metadata property name and value pairs to be associated with key.
type: object
example:
fruit: Apple
vegetable: Tomato
x-cli-version: '2.5'