Skip to content

Commit

Permalink
feat(API): Add order param to comment list endpoints (#441)
Browse files Browse the repository at this point in the history
* Add order param to comment index endpoints

* Add compiled doc
  • Loading branch information
Varpuspaavi authored Oct 23, 2023
1 parent 79b1c3a commit 441c9c4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 9 deletions.
49 changes: 43 additions & 6 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -10967,6 +10967,15 @@
"type": "string"
}
}
},
{
"description": "Order direction. Can be one of: asc, desc.",
"name": "order",
"in": "query",
"example": "desc",
"schema": {
"type": "string"
}
}
],
"responses": {
Expand Down Expand Up @@ -11010,11 +11019,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments?branch=my-feature-branch&filters=unread&query=something&locale_ids=someId\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X GET \\\n -H 'Content-Type: application/json'"
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments?branch=my-feature-branch&filters=unread&query=something&locale_ids=someId&order=desc\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X GET \\\n -H 'Content-Type: application/json'"
},
{
"lang": "CLI v2",
"source": "phrase comments list \\\n--project_id <project_id> \\\n--key_id <key_id> \\\n--branch \"my-feature-branch\" \\\n--filters unread \\\n--query \"Some comment content\" \\\n--locale_ids someId \\\n--access_token <token>"
"source": "phrase comments list \\\n--project_id <project_id> \\\n--key_id <key_id> \\\n--branch \"my-feature-branch\" \\\n--filters unread \\\n--order desc \\\n--query \"Some comment content\" \\\n--locale_ids someId \\\n--access_token <token>"
}
],
"requestBody": {
Expand Down Expand Up @@ -11056,6 +11065,11 @@
"read",
"unread"
]
},
"order": {
"description": "Specify ordering of comments",
"type": "string",
"example": "desc"
}
}
}
Expand Down Expand Up @@ -11950,6 +11964,15 @@
"type": "string"
}
}
},
{
"description": "Order direction. Can be one of: asc, desc.",
"name": "order",
"in": "query",
"example": "desc",
"schema": {
"type": "string"
}
}
],
"responses": {
Expand Down Expand Up @@ -11996,11 +12019,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies?branch=my-feature-branch&filters=unread&query=something\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X GET \\\n -H 'Content-Type: application/json'"
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies?branch=my-feature-branch&filters=unread&query=something&order=desc\" \\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X GET \\\n -H 'Content-Type: application/json'"
},
{
"lang": "CLI v2",
"source": "phrase replies list \\\n--project_id <project_id> \\\n--key_id <key_id> \\\n--comment_id <comment_id> \\\n--branch \"my-feature-branch\" \\\n--filters unread \\\n--query \"Some comment content\" \\\n--access_token <token>"
"source": "phrase replies list \\\n--project_id <project_id> \\\n--key_id <key_id> \\\n--comment_id <comment_id> \\\n--branch \"my-feature-branch\" \\\n--filters unread \\\n--order desc \\\n--query \"Some comment content\" \\\n--access_token <token>"
}
],
"requestBody": {
Expand Down Expand Up @@ -12031,6 +12054,11 @@
"read",
"unread"
]
},
"order": {
"description": "Specify ordering of comments",
"type": "string",
"example": "desc"
}
}
}
Expand Down Expand Up @@ -24164,6 +24192,15 @@
"schema": {
"type": "string"
}
},
{
"description": "Order direction. Can be one of: asc, desc.",
"name": "order",
"in": "query",
"example": "desc",
"schema": {
"type": "string"
}
}
],
"responses": {
Expand Down Expand Up @@ -24207,11 +24244,11 @@
"x-code-samples": [
{
"lang": "Curl",
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/jobs/:job_id/comments?branch=my-feature-branch\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
"source": "curl \"https://api.phrase.com/v2/projects/:project_id/jobs/:job_id/comments?branch=my-feature-branch&order=desc\" \\\n -u USERNAME_OR_ACCESS_TOKEN"
},
{
"lang": "CLI v2",
"source": "phrase job_comments list \\\n--project_id <project_id> \\\n--job_id <key_id> \\\n--branch my-feature-branch \\\n--access_token <token>"
"source": "phrase job_comments list \\\n--project_id <project_id> \\\n--job_id <key_id> \\\n--branch my-feature-branch \\\n--order desc \\\n--access_token <token>"
}
],
"x-cli-version": "2.5"
Expand Down
13 changes: 12 additions & 1 deletion paths/comment_replies/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ parameters:
example: [read, unread]
items:
type: string
- description: 'Order direction. Can be one of: asc, desc.'
name: order
in: query
example: desc
schema:
type: string
responses:
'200':
description: OK
Expand Down Expand Up @@ -60,7 +66,7 @@ responses:
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies?branch=my-feature-branch&filters=unread&query=something" \
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies?branch=my-feature-branch&filters=unread&query=something&order=desc" \
-u USERNAME_OR_ACCESS_TOKEN \
-X GET \
-H 'Content-Type: application/json'
Expand All @@ -72,6 +78,7 @@ x-code-samples:
--comment_id <comment_id> \
--branch "my-feature-branch" \
--filters unread \
--order desc \
--query "Some comment content" \
--access_token <token>
requestBody:
Expand All @@ -96,4 +103,8 @@ requestBody:
items:
type: string
example: [read, unread]
order:
description: Specify ordering of comments
type: string
example: desc
x-cli-version: '2.10'
13 changes: 12 additions & 1 deletion paths/comments/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ parameters:
example: [read, unread]
items:
type: string
- description: 'Order direction. Can be one of: asc, desc.'
name: order
in: query
example: desc
schema:
type: string
responses:
'200':
description: OK
Expand Down Expand Up @@ -65,7 +71,7 @@ responses:
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments?branch=my-feature-branch&filters=unread&query=something&locale_ids=someId" \
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments?branch=my-feature-branch&filters=unread&query=something&locale_ids=someId&order=desc" \
-u USERNAME_OR_ACCESS_TOKEN \
-X GET \
-H 'Content-Type: application/json'
Expand All @@ -76,6 +82,7 @@ x-code-samples:
--key_id <key_id> \
--branch "my-feature-branch" \
--filters unread \
--order desc \
--query "Some comment content" \
--locale_ids someId \
--access_token <token>
Expand Down Expand Up @@ -107,4 +114,8 @@ requestBody:
items:
type: string
example: [read, unread]
order:
description: Specify ordering of comments
type: string
example: desc
x-cli-version: '2.5'
9 changes: 8 additions & 1 deletion paths/job_comments/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ parameters:
in: query
schema:
type: string
- description: 'Order direction. Can be one of: asc, desc.'
name: order
in: query
example: desc
schema:
type: string
responses:
'200':
description: OK
Expand Down Expand Up @@ -41,13 +47,14 @@ responses:
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/projects/:project_id/jobs/:job_id/comments?branch=my-feature-branch" \
curl "https://api.phrase.com/v2/projects/:project_id/jobs/:job_id/comments?branch=my-feature-branch&order=desc" \
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase job_comments list \
--project_id <project_id> \
--job_id <key_id> \
--branch my-feature-branch \
--order desc \
--access_token <token>
x-cli-version: '2.5'

0 comments on commit 441c9c4

Please sign in to comment.