-
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): add Linked Keys endpoints (#555)
* Add linked keys * Fix comments: Naming * Fix comments: Naming
- Loading branch information
1 parent
0b36241
commit 4935dac
Showing
9 changed files
with
417 additions
and
2 deletions.
There are no files selected for viewing
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,36 @@ | ||
summary: Batch unlink child keys from a parent key | ||
description: Unlinks multiple child keys from a given parent key in a single operation. | ||
operationId: key_links/batch_destroy | ||
tags: | ||
- Linked Keys | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- in: query | ||
name: unlink_parent | ||
required: false | ||
description: Whether to unlink the parent key as well and unmark it as linked-key. | ||
schema: | ||
type: boolean | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
required: | ||
- child_key_ids | ||
type: object | ||
title: key_links/batch_destroy/parameters | ||
properties: | ||
child_key_ids: | ||
description: The IDs of the child keys to unlink from the parent key. | ||
type: array | ||
example: ["child_key_id1", "child_key_id2"] | ||
items: | ||
type: string | ||
|
||
responses: | ||
'200': | ||
description: OK | ||
'422': | ||
"$ref": "../../responses.yaml#/422" |
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,35 @@ | ||
--- | ||
summary: Link child keys to a parent key | ||
description: Creates links between a given parent key and one or more child keys. | ||
operationId: key_links/create | ||
tags: | ||
- Linked Keys | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
required: | ||
- child_key_ids | ||
type: object | ||
title: key_links/create/parameters | ||
properties: | ||
child_key_ids: | ||
description: The IDs of the child keys to link to the parent key. Can be left empty, to only mark the given translation-key as parent | ||
type: array | ||
example: ["child_key_id1", "child_key_id2"] | ||
items: | ||
type: string | ||
|
||
responses: | ||
'201': | ||
description: Created | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/key_link.yaml#/key_link" | ||
'422': | ||
"$ref": "../../responses.yaml#/422" |
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,21 @@ | ||
--- | ||
summary: Unlink a child key from a parent key | ||
description: Unlinks a single child key from a given parent key. | ||
operationId: key_links/destroy | ||
tags: | ||
- Linked Keys | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- in: path | ||
name: child_key_id | ||
required: true | ||
description: The ID of the child key to unlink. | ||
schema: | ||
type: string | ||
|
||
responses: | ||
'200': | ||
description: OK | ||
'422': | ||
"$ref": "../../responses.yaml#/422" |
Oops, something went wrong.