Skip to content

Commit

Permalink
TASK: updating OAS and Postman definition
Browse files Browse the repository at this point in the history
  • Loading branch information
automation-commercetools committed Dec 10, 2018
1 parent 3932b70 commit 5b98b89
Show file tree
Hide file tree
Showing 3 changed files with 951 additions and 1 deletion.
299 changes: 299 additions & 0 deletions api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,89 @@
"action"
]
},
"ApiClient": {
"title": "ApiClient",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"scope": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"lastUsedAt": {
"type": "string",
"format": "date"
},
"secret": {
"type": "string"
}
},
"required": [
"id",
"name",
"scope",
"createdAt",
"lastUsedAt"
],
"x-annotation-package": "ApiClient",
"x-annotation-docs-uri": "https://docs.commercetools.com/http-api-projects-apiClients.html#apiclient"
},
"ApiClientDraft": {
"title": "ApiClientDraft",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"scope": {
"type": "string"
}
},
"required": [
"name",
"scope"
],
"x-annotation-package": "ApiClient",
"x-annotation-docs-uri": "https://docs.commercetools.com/http-api-projects-apiClients.html#apiclientdraft"
},
"ApiClientPagedQueryResponse": {
"title": "ApiClientPagedQueryResponse",
"type": "object",
"properties": {
"count": {
"format": "int64",
"type": "number"
},
"total": {
"format": "int64",
"type": "number"
},
"offset": {
"format": "int64",
"type": "number"
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/ApiClient"
}
}
},
"required": [
"count",
"offset",
"results"
],
"x-annotation-package": "ApiClient"
},
"CartDiscount": {
"title": "CartDiscount",
"allOf": [
Expand Down Expand Up @@ -39652,6 +39735,222 @@
}
],
"x-annotation-methodName": "withId"
},
"/{projectKey}/api-clients": {
"get": {
"description": "Query api-clients",
"operationId": "GET_projectKey-api-clients",
"responses": {
"200": {
"$ref": "#/responses/trait:deprecatable:200"
},
"400": {
"$ref": "#/responses/trait:errorable:400"
},
"404": {
"$ref": "#/responses/trait:errorable:404"
},
"500": {
"$ref": "#/responses/trait:errorable:500"
},
"503": {
"$ref": "#/responses/trait:errorable:503"
}
},
"parameters": [
{
"description": "If queries support ad-hoc filtering of resources through flexible predicates, they do so via the where query\nparameter that accepts a single (possibly compound) predicate to determine whether a specific resource\nrepresentation should be included in the result.\n\nThe structure of predicates and the names of the fields follow the structure and naming of the fields in the\ndocumented response representation of the query results.\n\nExamples of predicates:\n\n // Compare a field's value to a given value\n name = \"Peter\"\n age < 42\n age > 42\n age <= 42\n age >= 42\n age <> 42\n\n // Combine any two conditional expressions in a logical conjunction / disjunction\n name = \"Peter\" and age < 42\n name = \"Peter\" or age < 42\n\n // Negate any other conditional expression\n not (name = \"Peter\" and age < 42)\n\n // Check whether a field's value is or is not contained in\n // a specified set of values.\n age in (42, 43, 44)\n age not in (42, 43, 44)\n\n // Check whether an array contains all or any of a set of values\n tags contains all (\"a\", \"b\", \"c\")\n tags contains any (\"a\", \"b\", \"c\")\n\n // Check whether an array is empty\n tags is empty\n\n // Check whether a field exists & has a non-null value\n name is defined\n name is not defined\n\n // Descend into nested objects\n dog(age < 7 and name = \"Beethoven\")\n\n // Descend into nested arrays of objects\n cities(zip > 10000 and zip < 20000)\n\nA query endpoint usually restricts predicates to only be allowed on a specified subset of a resource\nrepresentation's fields. The documentation of the endpoint will therefore list fields that can be used\nfor constructing predicates.\n\nIf multiple predicates are specified via multiple where query parameters, the individual predicates are\ncombined in a logical conjunction, just as if they had been specified in a single where query parameter\nand combined with and.\n\nNote: The encoding of the predicates is UTF-8 and the predicate must be URL-encoded in the HTTP request.\n",
"type": "string",
"in": "query",
"name": "where"
},
{
"description": "A query endpoint that supports sorting does so through the sort query parameter. The provided value must be\na valid sort expression. The default sort direction is ASC. The allowed sort paths are typically listed on\nthe specific query endpoints.\n\nHere are some examples of sort expressions:\n\n name desc\n dog.age asc\n\nIf multiple sort expressions are specified via multiple sort parameters, they are combined into a composed\nsort where the results are first sorted by the first expression, followed by equal values being sorted\naccording to the second expression, and so on.\n\nNote: The sorting is case sensitive.\n",
"type": "string",
"in": "query",
"name": "sort"
},
{
"$ref": "#/parameters/trait:expandable:expand"
},
{
"$ref": "#/parameters/trait:paging:limit"
},
{
"$ref": "#/parameters/trait:paging:offset"
},
{
"$ref": "#/parameters/trait:paging:withTotal"
}
],
"security": [
{
"oauth_2_0": [
"manage_api_clients:{projectKey}",
"view_api_clients:{projectKey}"
]
}
]
},
"post": {
"description": "Create ApiClient",
"operationId": "POST_projectKey-api-clients",
"responses": {
"200": {
"$ref": "#/responses/trait:deprecatable:200"
},
"201": {
"description": "",
"examples": {
"application/json": {
"id": "api-client-id",
"name": "api-client-name",
"scope": "view_products",
"createdAt": "2018-01-01T00:00:00.001Z",
"lastUsedAt": "2017-9-10",
"secret": "secret-passphrase"
}
},
"schema": {
"$ref": "#/definitions/ApiClient"
}
},
"400": {
"$ref": "#/responses/trait:errorable:400"
},
"404": {
"$ref": "#/responses/trait:errorable:404"
},
"500": {
"$ref": "#/responses/trait:errorable:500"
},
"503": {
"$ref": "#/responses/trait:errorable:503"
}
},
"parameters": [
{
"schema": {
"example": {
"name": "api-client-name",
"scope": "view_products"
},
"$ref": "#/definitions/ApiClientDraft"
},
"in": "body",
"name": "body",
"required": true
},
{
"$ref": "#/parameters/trait:expandable:expand"
}
],
"security": [
{
"oauth_2_0": [
"manage_api_clients:{projectKey}"
]
}
]
},
"parameters": [
{
"type": "string",
"in": "path",
"name": "projectKey",
"required": true
}
]
},
"/{projectKey}/api-clients/{ID}": {
"get": {
"description": "Get ApiClient by ID",
"operationId": "GET_projectKey-api-clients-ID",
"responses": {
"200": {
"$ref": "#/responses/trait:deprecatable:200"
},
"400": {
"$ref": "#/responses/trait:errorable:400"
},
"404": {
"$ref": "#/responses/trait:errorable:404"
},
"500": {
"$ref": "#/responses/trait:errorable:500"
},
"503": {
"$ref": "#/responses/trait:errorable:503"
}
},
"parameters": [
{
"$ref": "#/parameters/trait:expandable:expand"
}
],
"security": [
{
"oauth_2_0": [
"manage_api_clients:{projectKey}",
"view_api_clients:{projectKey}"
]
}
]
},
"delete": {
"description": "Delete ApiClient by ID",
"operationId": "DELETE_projectKey-api-clients-ID",
"responses": {
"200": {
"$ref": "#/responses/trait:deprecatable:200"
},
"400": {
"$ref": "#/responses/trait:errorable:400"
},
"404": {
"$ref": "#/responses/trait:errorable:404"
},
"409": {
"$ref": "#/responses/trait:conflicting:409"
},
"500": {
"$ref": "#/responses/trait:errorable:500"
},
"503": {
"$ref": "#/responses/trait:errorable:503"
}
},
"parameters": [
{
"$ref": "#/parameters/trait:versioned:version"
},
{
"$ref": "#/parameters/trait:expandable:expand"
}
],
"security": [
{
"oauth_2_0": [
"manage_api_clients:{projectKey}"
]
}
]
},
"parameters": [
{
"type": "string",
"in": "path",
"name": "ID",
"required": true
},
{
"type": "string",
"in": "path",
"name": "projectKey",
"required": true
}
],
"x-annotation-methodName": "withId"
}
}
}
Loading

0 comments on commit 5b98b89

Please sign in to comment.