attributes.json

What each attribute value means.

attributes

What an attribute's values mean: their type, unit, known values and how they are used. Facets are laid out in categories.json, searched fields in types.json.

codestringRequired

The code of an attribute definition, such as color or seat_height. The reserved words any, all, not, category, brand, price, on_sale, availability, delivery_days and rating cannot be attribute codes.

typestringRequired
8 values

Free text: searchable, never a filter.

GTIN, MPN, ISBN and similar: exact match after normalization.

Enumerated values with labels, aliases, order, groups and swatches.

A number without a unit.

A number with a unit of one dimension.

A minimum and a maximum with a unit, such as age 3 to 6.

A date or a point in time.

labelstring or map of strings

A plain value, or a map from locale to value such as { "de": "Farbe", "en": "Color" }.

levelstring

Whether the value belongs to the product or differs per variant. Default: product.

2 values

Whether the value belongs to the product or differs per variant. Default: product.

Whether the value belongs to the product or differs per variant. Default: product.

multipleboolean

The value is a list, such as several materials.

localizedboolean

The value differs per locale. For text and, rarely, option.

unitstring

Quantities and ranges: the one canonical unit every value is converted to.

27 values

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

Quantities and ranges: the one canonical unit every value is converted to.

precisioninteger

Numbers, quantities and ranges: the decimal places shown.

valuesarray of objects

Options: the known values, in display order. Their aliases merge other spellings into them; a value nobody listed becomes a value of its own and a merge suggestion in the panel, so nothing is dropped.

A known value of an option attribute.

9 fields
codestringRequired

The code of an option value or option group, such as grey or 160x230.

labelstring or map of strings

A plain value, or a map from locale to value such as { "de": "Farbe", "en": "Color" }.

aliasesarray of strings

Spellings that mean this value, matched without regard to case, such as Rot and rouge for red.

slugstring or map of strings

Its word in URLs, per locale, such as anthrazit. It is made from the label when the value is created and stays when the label changes, so a URL that holds it never moves by accident. A release that leaves it out has it made from the label at every run, and the run report names it.

slug_aliasesarray of strings or map of arrays of strings

The slugs it had before, per locale: a URL that holds one is read as the value and leads to its slug. A write that changes the slug keeps the old one here; deleting one is deliberate.

groupstring or array of strings

The group or groups the value is shown under.

swatchstring

A swatch color in hexadecimal notation, such as #C62828.

imagestring

A swatch image, such as a pattern or a mix of colors that no single color shows; its URL.

descriptionstring or map of strings

What the value means, shown under it in a facet and read with it, such as "Coated fabric with the look of leather".

groupsarray of objects

Options: groups that show different values under one filter, such as burgundy and red under Red.

Values shown under one filter. A selector naming a group means every value in it; a code that is both a value and a group means the group.

8 fields
codestringRequired

The code of an option value or option group, such as grey or 160x230.

labelstring or map of strings

A plain value, or a map from locale to value such as { "de": "Farbe", "en": "Color" }.

aliasesarray of strings

Words in a query that mean the group, such as grau for grey.

slugstring or map of strings

Its word in URLs, per locale, such as anthrazit. It is made from the label when the value is created and stays when the label changes, so a URL that holds it never moves by accident. A release that leaves it out has it made from the label at every run, and the run report names it.

slug_aliasesarray of strings or map of arrays of strings

The slugs it had before, per locale: a URL that holds one is read as the value and leads to its slug. A write that changes the slug keeps the old one here; deleting one is deliberate.

swatchstring

A swatch color in hexadecimal notation, such as #C62828.

imagestring

A swatch image, such as the pattern that stands for "mixed colors"; its URL.

descriptionstring or map of strings

What the group holds, shown under it in a facet and read with it.

Options: the import places values that have no group in a color group, by the built-in color words and by their swatch. An attribute without groups of its own has the built-in ones.

filterableboolean

Selectors, filters and facets may use the attribute. Changing it needs an index run.

sortableboolean

Sort options may use the attribute. Changing it needs an index run.

The query is searched for the attribute's values, so "grauer teppich" filters on grey.

source_namesarray of strings

Column names the import maps onto this attribute, in any language.

$schema

The JSON Schema an editor checks this file against; kept as written.

Example

tests/fixtures/home/attributes.json (trimmed)
{
  "$schema": "../../../contracts/schema/attributes.json",
  "attributes": [
    {
      "code": "color",
      "type": "option",
      "label": { "de": "Farbe", "en": "Color" },
      "level": "variant",
      "values": [
        {
          "code": "white",
          "label": { "de": "Weiß", "en": "White" },
          "aliases": ["weiß"],
          "slug": { "de": "weiss", "en": "white" },
          "group": "white",
          "swatch": "#FFFFFF"
        }
      ],
      "groups": [
        {
          "code": "white",
          "label": { "de": "Weiß", "en": "White" },
          "aliases": ["weiß"],
          "slug": { "de": "weiss", "en": "white" },
          "swatch": "#FFFFFF"
        }
      ],
      "color_groups": true,
      "filterable": true
    }
  ]
}

Guide: Types and attributes

On this page