Skip to content

Commit

Permalink
update README, update update endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan committed Dec 21, 2023
1 parent 8477af8 commit c88df43
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 85 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,31 @@ https://github.com/phrase/phrase-cli

[https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/)

### Defining parameters

`POST`/`PUT` requests should define parameters within `requestBody` section, like the following:

```yaml
requestBody:
required: true
content:
application/json:
schema:
type: object
title: key/create/parameters
properties:
branch:
description: specify the branch to use
type: string
example: my-feature-branch
name:
description: Key name
type: string
example: home.index.headline
```
`parameters` section should contain only those parameters which are part of the URL (typically `project_id` and/or `account_id`)

## Get help / support

Please contact [[email protected]](mailto:[email protected]?subject=[GitHub]%20openapi) and we can take more direct action toward finding a solution.
96 changes: 45 additions & 51 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -6392,60 +6392,54 @@
},
{
"$ref": "#/components/parameters/id"
},
{
"description": "name of the property",
"example": [
"Fruit"
],
"name": "name",
"in": "query",
"schema": {
"type": "string"
}
},
{
"description": "description of property",
"example": [
"A healthy snack for all ages"
],
"name": "description",
"in": "query",
"schema": {
"type": "string"
}
},
{
"description": "ids of projects that the property belongs to",
"example": [
"abcd1234cdef1234abcd1234cdef1234"
],
"name": "project_ids",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"description": "value options of property (only applies to single or multi select properties)",
"example": [
"Apple",
"Banana",
"Coconut"
],
"name": "value_options",
"in": "query",
"schema": {
"type": "array",
"items": {
"type": "string"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "custom_metadata_properties/update/parameters",
"properties": {
"name": {
"description": "name of the property",
"example": "Fruit",
"type": "string"
},
"project_ids": {
"description": "ids of projects that the property belongs to",
"type": "array",
"example": [
"abcd1234cdef1234abcd1234cdef1234",
"abcd1234cdef1234abcd1234cdef4321"
],
"items": {
"type": "string"
}
},
"description": {
"description": "description of property",
"example": "A healthy snack for all ages",
"type": "string"
},
"value_options": {
"description": "value options of property (only applies to single or multi select properties)",
"example": [
"Apple",
"Banana",
"Coconut"
],
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
],
},
"responses": {
"200": {
"description": "OK",
Expand Down
68 changes: 34 additions & 34 deletions paths/custom_metadata_properties/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,40 @@ parameters:
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
- "$ref": "../../parameters.yaml#/account_id"
- "$ref": "../../parameters.yaml#/id"
- description: name of the property
example:
- Fruit
name: name
in: query
schema:
type: string
- description: description of property
example:
- A healthy snack for all ages
name: description
in: query
schema:
type: string
- description: ids of projects that the property belongs to
example:
- abcd1234cdef1234abcd1234cdef1234
name: project_ids
in: query
schema:
type: array
items:
type: string
- description: value options of property (only applies to single or multi select properties)
example:
- Apple
- Banana
- Coconut
name: value_options
in: query
schema:
type: array
items:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
title: custom_metadata_properties/update/parameters
properties:
name:
description: name of the property
example: Fruit
type: string
project_ids:
description: ids of projects that the property belongs to
type: array
example:
- abcd1234cdef1234abcd1234cdef1234
- abcd1234cdef1234abcd1234cdef4321
items:
type: string
description:
description: description of property
example: A healthy snack for all ages
type: string
value_options:
description: value options of property (only applies to single or multi select properties)
example:
- Apple
- Banana
- Coconut
type: array
items:
type: string

responses:
'200':
description: OK
Expand Down

0 comments on commit c88df43

Please sign in to comment.