Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Apr 18, 2024
1 parent a43b947 commit 32b48b6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
22 changes: 17 additions & 5 deletions api-specs/frontend-api/api.raml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ annotationTypes:
(products):
- Frontend

baseUri: https://{project}-{customer}.frontastic.io
baseUri: https://PROJECT_NAME-COMPANY_NAME.frontastic.TLD
baseUriParameters:
project:
PROJECT_NAME:
description: Project Name
type: string
required: true
customer:
description: Customer Name
COMPANY_NAME:
description: Company Name
type: string
required: true
TLD:
description: |
The top-level domain for the environment, which includes `.live`, `.io`, and `.rocks`. For more information, see [Hosts](/general#hosts).
type: string
required: true
version: 2.0.0
Expand Down Expand Up @@ -54,7 +59,7 @@ types:
BuildMetadata: !include types/BuildMetadata.raml
BuildUploadResult: !include types/BuildUploadResult.raml
traits:
right-header:
accept-header:
headers:
Accept:
displayName: Accept Header
Expand All @@ -69,6 +74,13 @@ traits:
displayName: Frontastic Locale
type: Locale
description: Locale
common-headers:
headers:
extension-version:
displayName: Commercetools-Frontend-Extension-Version
type: string
description: |
[Extension version](/../frontend-development/extensions#extension-version)
action-errorable:
responses:
400:
Expand Down
9 changes: 6 additions & 3 deletions api-specs/frontend-api/resources/FrontasticAction.raml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
get:
is:
- action-errorable
- right-header
- accept-header
- frontastic-locale
- common-headers
description: Use the GET method to allow the frontend to fetch data from a backend system. For the response, we recommend to use standard HTTP codes and `application/json` encoded content. The response will be structured [as defined by the `body` property of the action](/../frontend-development/developing-an-action-extension#1-implement-the-action). The following response example contains information about a cart.
responses:
200:
Expand All @@ -26,7 +27,8 @@
post:
is:
- action-errorable
- right-header
- accept-header
- common-headers
- frontastic-locale
description: Use the POST method to write data to a backend system. Any JSON serializable payload is accepted. The following request example adds a product to a cart. For the response, we recommend to use standard HTTP codes and `application/json` encoded content. The response will be structured [as defined by the `body` property of the action](/../frontend-development/developing-an-action-extension#1-implement-the-action). The following response example contains the updated cart information, which includes the added product.
body:
Expand All @@ -43,7 +45,8 @@
put:
is:
- action-errorable
- right-header
- accept-header
- common-headers
- frontastic-locale
description: Use the PUT method to write data to a backend system. Any JSON serializable payload is accepted. The following request example adds a product to a cart. For the response, we recommend to use standard HTTP codes and `application/json` encoded content. The response will be structured [as defined by the `body` property of the action](/../frontend-development/developing-an-action-extension#1-implement-the-action). The following response example contains the updated cart information, which includes the added product.
body:
Expand Down
5 changes: 4 additions & 1 deletion api-specs/frontend-api/resources/FrontasticContext.raml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#%RAML 1.0 ResourceType
get:
is:
- right-header
- accept-header
- common-headers
description: |
Returns information about the project locales setup and the environment in which the requested host acts in. \
Headers:
- `Accept` - `application/json` - Required
- `Commercetools-Frontend-Extension-Version` - [Extension version](/../frontend-development/extensions#extension-version) - Required
responses:
200:
description: Locales and environment information.
Expand Down
4 changes: 3 additions & 1 deletion api-specs/frontend-api/resources/FrontasticPage.raml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#%RAML 1.0 ResourceType
get:
is:
- right-header
- accept-header
- common-headers
- frontastic-locale
headers:
Frontastic-Path:
Expand All @@ -18,6 +19,7 @@ get:
- `Frontastic-Path` - `^/.*$` - Required
- `Accept` - `application/json` - Required
- `Frontastic-Locale` - [Locale](ctp:frontend-api:type:Locale) - Required
- `Commercetools-Frontend-Extension-Version` - [Extension version](/../frontend-development/extensions#extension-version) - Required
responses:
200:
Expand Down
4 changes: 3 additions & 1 deletion api-specs/frontend-api/resources/FrontasticPreview.raml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#%RAML 1.0 ResourceType
get:
is:
- right-header
- accept-header
- common-headers
queryParameters:
locale:
displayName: Locale
Expand All @@ -20,6 +21,7 @@ get:
Headers:
- `Accept` - `application/json` - Required
- `Commercetools-Frontend-Extension-Version` - [Extension version](/../frontend-development/extensions#extension-version) - Required
responses:
200:
Expand Down

0 comments on commit 32b48b6

Please sign in to comment.