-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(API): Introduce comment replies endpoints (#383)
* Adjusted comment schema and #create endpoint * Added comment replies documentation * Adjusted #create endpoint documentation for comment/reaction * Fix lint * Adjust to x-cli-version: '2.10'
- Loading branch information
1 parent
82ced72
commit 71351ac
Showing
12 changed files
with
881 additions
and
9 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
summary: Create a reply | ||
description: Create a new reply for a comment. | ||
operationId: reply/create | ||
tags: | ||
- Comment Replies | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/key_id" | ||
- "$ref": "../../parameters.yaml#/comment_id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
- description: specify the message for the comment | ||
example: some message... | ||
name: message | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
'201': | ||
description: Created | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/comment.yaml#/comment" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'403': | ||
"$ref": "../../responses.yaml#/403" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-d '{"branch":"my-feature-branch", "message":"Some message..."}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase replies create \ | ||
--project_id <project_id> \ | ||
--key_id <key_id> \ | ||
--comment_id <comment_id> \ | ||
--data '{"branch":"my-feature-branch", "message": "Some message..."]}' \ | ||
--access_token <token> | ||
x-cli-version: '2.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
summary: Delete a reply | ||
description: Delete an existing reply. | ||
operationId: reply/delete | ||
tags: | ||
- Comment Replies | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/key_id" | ||
- "$ref": "../../parameters.yaml#/comment_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
'204': | ||
"$ref": "../../responses.yaml#/204" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'403': | ||
"$ref": "../../responses.yaml#/403" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/:id" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X DELETE \ | ||
-d '{"branch":"my-feature-branch"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase replies delete \ | ||
--project_id <project_id> \ | ||
--key_id <key_id> \ | ||
--comment_id <comment_id> \ | ||
--id <id> \ | ||
--data '{"branch":"my-feature-branch"]}' \ | ||
--access_token <token> | ||
x-cli-version: '2.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
summary: List replies | ||
description: List all replies for a comment. | ||
operationId: replies/list | ||
tags: | ||
- Comment Replies | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/key_id" | ||
- "$ref": "../../parameters.yaml#/comment_id" | ||
- "$ref": "../../parameters.yaml#/page" | ||
- "$ref": "../../parameters.yaml#/per_page" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
"$ref": "../../schemas/comment.yaml#/comment" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
Link: | ||
"$ref": "../../headers.yaml#/Link" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'403': | ||
"$ref": "../../responses.yaml#/403" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X GET \ | ||
-d '{"branch":"my-feature-branch"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase replies list \ | ||
--project_id <project_id> \ | ||
--key_id <key_id> \ | ||
--comment_id <comment_id> \ | ||
--data '{"branch":"my-feature-branch"]}' \ | ||
--access_token <token> | ||
x-cli-version: '2.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
summary: Mark a reply as read | ||
description: Mark a reply as read. | ||
operationId: reply/mark_as_read | ||
tags: | ||
- Comment Replies | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/key_id" | ||
- "$ref": "../../parameters.yaml#/comment_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
'204': | ||
"$ref": "../../responses.yaml#/204" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'403': | ||
"$ref": "../../responses.yaml#/403" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/:id/mark_as_read" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X PATCH \ | ||
-d '{"branch":"my-feature-branch"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase replies mark_as_read \ | ||
--project_id <project_id> \ | ||
--key_id <key_id> \ | ||
--comment_id <comment_id> \ | ||
--id <id> \ | ||
--data '{"branch":"my-feature-branch"]}' \ | ||
--access_token <token> | ||
x-cli-version: '2.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
summary: Mark a reply as unread | ||
description: Mark a reply as unread. | ||
operationId: reply/mark_as_unread | ||
tags: | ||
- Comment Replies | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/key_id" | ||
- "$ref": "../../parameters.yaml#/comment_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
'204': | ||
"$ref": "../../responses.yaml#/204" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'403': | ||
"$ref": "../../responses.yaml#/403" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/:id/mark_as_unread" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X PATCH \ | ||
-d '{"branch":"my-feature-branch"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase replies mark_as_unread \ | ||
--project_id <project_id> \ | ||
--key_id <key_id> \ | ||
--comment_id <comment_id> \ | ||
--id <id> \ | ||
--data '{"branch":"my-feature-branch"]}' \ | ||
--access_token <token> | ||
x-cli-version: '2.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
summary: Get a single reply | ||
description: Get details on a single reply. | ||
operationId: reply/show | ||
tags: | ||
- Comment Replies | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/project_id" | ||
- "$ref": "../../parameters.yaml#/key_id" | ||
- "$ref": "../../parameters.yaml#/comment_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
- description: specify the branch to use | ||
example: my-feature-branch | ||
name: branch | ||
in: query | ||
schema: | ||
type: string | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/comment.yaml#/comment" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'403': | ||
"$ref": "../../responses.yaml#/403" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/:id" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X GET \ | ||
-d '{"branch":"my-feature-branch"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase replies show \ | ||
--project_id <project_id> \ | ||
--key_id <key_id> \ | ||
--comment_id <comment_id> \ | ||
--id <id> \ | ||
--data '{"branch":"my-feature-branch"]}' \ | ||
--access_token <token> | ||
x-cli-version: '2.10' |
Oops, something went wrong.