ValidateDynamicExpression

Validate the precomputed dynamic category expression for correctness.

Request

HTTP Request

POST
 api/commerce/catalog/admin/categories/ValidateDynamicExpression%3fresponseFields%3d%7bresponseFields%7d

Parameters

Parameter NameDescription
Parameters
responseFieldstype: string 

Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.

Required Behaviors

  • Product Category Create

Request Properties

The details of the dynamic expression that you want to validate.

PropertyDescription
text

type: string

The text view of the dynamic expression. For example, instead of writing a structure JSON object, you can write a simple string as the dynamic expression.

tree

type: expression

The tree view of the dynamic expression. This is a structure JSON object that gives you greater control and flexibility over the text view when writing the dynamic expression.

expression.left

type: string

The expression field you wish to target. For example, if you wish to target the productCode field, this value would be productCode.

Refer to Dynamic Category Expressions for more information about the supported expression fields.

expression.logicalOperator

type: string

The logical operator you wish to perform on the nodes within the dynamic expression. Valid values are: "And", and "Or".

expression.nodes

type: list of Mozu.ProductAdmin.Contracts.Expression

The node or container of the self-contained dynamic expression. The node contains the following expression fields in order: "type", "left", "operator", and "right".

For example, a dynamic expression that specifies to include all products that are in the apparel category would have the following node:

"type": "predicate", "left": "Categories.CategoryCode", "operator": "eq", "right": "apparel".

expression.operator

type: string

The operator you wish to perform on the left field. The valid values of this field are dependent on the left expression field. Refer to Dynamic Category Expressions for more information about the supported expression field operators.

expression.right

type: object

The literal values of the predicate that is validated against the combined values of the left and operator fields.

For example, you wish to validate on products that have a product code of "shoe". You would write the following expression:

"type": "predicate", "left": "productCode", "operator": "eq", "right": "shoe".

expression.type

type: string

The type of scope, which is a developer account or production tenant.

Request Body

Response Properties

If the dynamic expression is valid, this operation returns the same dynamic expression. If it is not valid, this operation throws an error.

PropertyDescription
text

type: string

The text view of the dynamic expression. For example, instead of writing a structure JSON object, you can write a simple string as the dynamic expression.

tree

type: expression

The tree view of the dynamic expression. This is a structure JSON object that gives you greater control and flexibility over the text view when writing the dynamic expression.

expression.left

type: string

The expression field you wish to target. For example, if you wish to target the productCode field, this value would be productCode.

Refer to Dynamic Category Expressions for more information about the supported expression fields.

expression.logicalOperator

type: string

The logical operator you wish to perform on the nodes within the dynamic expression. Valid values are: "And", and "Or".

expression.nodes

type: list of Mozu.ProductAdmin.Contracts.Expression

The node or container of the self-contained dynamic expression. The node contains the following expression fields in order: "type", "left", "operator", and "right".

For example, a dynamic expression that specifies to include all products that are in the apparel category would have the following node:

"type": "predicate", "left": "Categories.CategoryCode", "operator": "eq", "right": "apparel".

expression.operator

type: string

The operator you wish to perform on the left field. The valid values of this field are dependent on the left expression field. Refer to Dynamic Category Expressions for more information about the supported expression field operators.

expression.right

type: object

The literal values of the predicate that is validated against the combined values of the left and operator fields.

For example, you wish to validate on products that have a product code of "shoe". You would write the following expression:

"type": "predicate", "left": "productCode", "operator": "eq", "right": "shoe".

expression.type

type: string

The type of scope, which is a developer account or production tenant.

Response Body