Skip to content

Commit e201d13

Browse files
authored
fix(API): Comment creation schema fix #STRINGS-866 (#718)
1 parent f90370f commit e201d13

File tree

3 files changed

+78
-75
lines changed

3 files changed

+78
-75
lines changed

doc/compiled.json

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13093,27 +13093,6 @@
1309313093
},
1309413094
{
1309513095
"$ref": "#/components/parameters/key_id"
13096-
},
13097-
{
13098-
"description": "specify the message for the comment",
13099-
"example": "some message...",
13100-
"name": "message",
13101-
"in": "query",
13102-
"schema": {
13103-
"type": "string"
13104-
}
13105-
},
13106-
{
13107-
"description": "specify the locales for the comment",
13108-
"example": "someId",
13109-
"name": "locale_ids",
13110-
"in": "query",
13111-
"schema": {
13112-
"type": "array",
13113-
"items": {
13114-
"type": "string"
13115-
}
13116-
}
1311713096
}
1311813097
],
1311913098
"responses": {
@@ -13165,16 +13144,30 @@
1316513144
"schema": {
1316613145
"type": "object",
1316713146
"title": "comment/create/parameters",
13147+
"required": [
13148+
"message"
13149+
],
1316813150
"properties": {
13151+
"message": {
13152+
"description": "Comment message",
13153+
"type": "string",
13154+
"example": "Some message..."
13155+
},
1316913156
"branch": {
1317013157
"description": "specify the branch to use",
1317113158
"type": "string",
1317213159
"example": "my-feature-branch"
1317313160
},
13174-
"message": {
13175-
"description": "Comment message",
13176-
"type": "string",
13177-
"example": "Some message..."
13161+
"locale_ids": {
13162+
"description": "specify the locales for the comment",
13163+
"type": "array",
13164+
"items": {
13165+
"type": "string"
13166+
},
13167+
"example": [
13168+
"someId",
13169+
"someOtherId"
13170+
]
1317813171
}
1317913172
}
1318013173
}
@@ -14091,26 +14084,34 @@
1409114084
},
1409214085
{
1409314086
"$ref": "#/components/parameters/comment_id"
14094-
},
14095-
{
14096-
"description": "specify the branch to use",
14097-
"example": "my-feature-branch",
14098-
"name": "branch",
14099-
"in": "query",
14100-
"schema": {
14101-
"type": "string"
14102-
}
14103-
},
14104-
{
14105-
"description": "specify the message for the comment",
14106-
"example": "some message...",
14107-
"name": "message",
14108-
"in": "query",
14109-
"schema": {
14110-
"type": "string"
14111-
}
1411214087
}
1411314088
],
14089+
"requestBody": {
14090+
"required": true,
14091+
"content": {
14092+
"application/json": {
14093+
"schema": {
14094+
"type": "object",
14095+
"title": "comment/create/parameters",
14096+
"required": [
14097+
"message"
14098+
],
14099+
"properties": {
14100+
"message": {
14101+
"description": "Reply message body",
14102+
"type": "string",
14103+
"example": "Some message..."
14104+
},
14105+
"branch": {
14106+
"description": "Specify the branch to use",
14107+
"type": "string",
14108+
"example": "my-feature-branch"
14109+
}
14110+
}
14111+
}
14112+
}
14113+
}
14114+
},
1411414115
"responses": {
1411514116
"201": {
1411614117
"description": "Created",
@@ -14149,7 +14150,7 @@
1414914150
"x-code-samples": [
1415014151
{
1415114152
"lang": "Curl",
14152-
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"branch\":\"my-feature-branch\", \"message\":\"Some message...\"}' \\\n -H 'Content-Type: application/json'"
14153+
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -d '{\"branch\":\"my-feature-branch\", \"message\":\"Some message...\"}' \\\n -H 'Content-Type: application/json'"
1415314154
},
1415414155
{
1415514156
"lang": "CLI v2",

paths/comment_replies/create.yaml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,24 @@ parameters:
99
- "$ref": "../../parameters.yaml#/project_id"
1010
- "$ref": "../../parameters.yaml#/key_id"
1111
- "$ref": "../../parameters.yaml#/comment_id"
12-
- description: specify the branch to use
13-
example: my-feature-branch
14-
name: branch
15-
in: query
16-
schema:
17-
type: string
18-
- description: specify the message for the comment
19-
example: some message...
20-
name: message
21-
in: query
22-
schema:
23-
type: string
12+
requestBody:
13+
required: true
14+
content:
15+
application/json:
16+
schema:
17+
type: object
18+
title: comment/create/parameters
19+
required:
20+
- message
21+
properties:
22+
message:
23+
description: Reply message body
24+
type: string
25+
example: Some message...
26+
branch:
27+
description: Specify the branch to use
28+
type: string
29+
example: my-feature-branch
2430
responses:
2531
'201':
2632
description: Created
@@ -46,7 +52,7 @@ responses:
4652
x-code-samples:
4753
- lang: Curl
4854
source: |-
49-
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/" \
55+
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies" \
5056
-u USERNAME_OR_ACCESS_TOKEN \
5157
-X POST \
5258
-d '{"branch":"my-feature-branch", "message":"Some message..."}' \

paths/comments/create.yaml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@ parameters:
88
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
99
- "$ref": "../../parameters.yaml#/project_id"
1010
- "$ref": "../../parameters.yaml#/key_id"
11-
- description: specify the message for the comment
12-
example: some message...
13-
name: message
14-
in: query
15-
schema:
16-
type: string
17-
- description: specify the locales for the comment
18-
example: someId
19-
name: locale_ids
20-
in: query
21-
schema:
22-
type: array
23-
items:
24-
type: string
2511
responses:
2612
'201':
2713
description: Created
@@ -64,13 +50,23 @@ requestBody:
6450
schema:
6551
type: object
6652
title: comment/create/parameters
53+
required:
54+
- message
6755
properties:
68-
branch:
69-
description: specify the branch to use
70-
type: string
71-
example: my-feature-branch
7256
message:
7357
description: Comment message
7458
type: string
7559
example: Some message...
60+
branch:
61+
description: specify the branch to use
62+
type: string
63+
example: my-feature-branch
64+
locale_ids:
65+
description: specify the locales for the comment
66+
type: array
67+
items:
68+
type: string
69+
example:
70+
- someId
71+
- someOtherId
7672
x-cli-version: '2.5'

0 commit comments

Comments
 (0)