Skip to content

Commit

Permalink
BAP-20442: Create documentation for X-Localization-ID and X-Currency …
Browse files Browse the repository at this point in the history
…headers for Storefront API (#29433)
  • Loading branch information
vsoroka authored Mar 18, 2021
1 parent d547167 commit 4042db6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
services:
oro_frontend_localization.api_doc.documentation_provider.frontend_x_localization_id_header:
class: Oro\Bundle\ApiBundle\ApiDoc\DocumentationProvider
arguments:
- '@@OroFrontendLocalizationBundle/Resources/doc/api_frontend/x_localization_id_header.md'
- '@file_locator'
tags:
- { name: oro.api.documentation_provider, requestType: frontend, priority: 230 }

oro_frontend_localization.api.update_localization_query:
class: Oro\Bundle\FrontendLocalizationBundle\Api\Processor\UpdateLocalizationQuery
arguments:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
By default, all locale sensitive data are received and returned in the locale selected for the current website.
To specify another locale, use the **X-Localization-ID** request header.
The list of available localization IDs can be received via the `/api/localizations` resource.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ name ~ "headlamp" and minimalPrice < 10
This query will find all products that contain the `headlamp` word in name, and which minimal price is less than 10.
It uses two simple expressions, `name ~ "headlamp"` and `minimalPrice < 10`, that are joined by the logical `and` operator.

The locale for the name is equal to the locale selected for the website or the locale specified in the **X-Localization-ID** HTTP header if it is provided.

The currency for the minimal price is equal to the currency selected for the website or the currency specified in the **X-Currency** HTTP header if it is provided.

The parentheses in complex queries can be used to enforce the precedence of operators. For example:

```
Expand Down

0 comments on commit 4042db6

Please sign in to comment.