DocsSchemas · FRL
On this page

Validate objects and arrays

Describe nested objects, arrays and union values.

Before you begin: Validate text and numbers.

Object Fields

Use type: "object" with fields for nested structured values.

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

When an object has nested fields, extra keys inside that object are also rejected.

Object-level rules:

RuleMeaning
requiredObject must be present.
minKeysMinimum number of object keys.
maxKeysMaximum number of object keys.
maxDepthMaximum nested object depth.
maxCharsMaximum JSON.stringify size.

Example:

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

Arrays

Use type: "array" with of or items for the element schema.

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

Array rules:

RuleMeaning
requiredArray must be present.
minMinimum array length.
maxMaximum array length.
uniqueReject repeated whole values. Object property order does not matter.
uniqueByReject repeated field values or combinations within an array of objects.

Use uniqueBy to keep one item per product, or one item per product and variant:

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

For one key, use uniqueBy: "productId". A list of paths defines one composite key: the same product can appear in different sizes, but each product-and-size combination can appear only once. Paths are relative to each item and must name declared fields. Every selected value must be present and cannot be null or empty text; 0 and false are valid values.

Both rules reject duplicates without removing items. Objects are compared recursively without considering property order. Array order, value types, string case and whitespace remain significant. These checks apply within this array, not across other records. The same comparison rules apply in FQL form validation.

Arrays can contain objects or files:

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

Union Values

oneOf is an alias for anyOf. Prefer anyOf in new themes.

Use anyOf when a value may be one of several allowed schema objects.

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

The value passes validation if it matches any option.

Continue with Store prices and references.