Skip to content

ColorAttribute

Type: schema

Description

Attribute for colors

TypeScript Definition

typescript
ColorAttribute: {{
            id: string;
            name: string;
            /** @description A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type` */
            key: string;
            /**
             * @description discriminator enum property added by openapi-typescript
             * @enum {string}
             */
            type: "color";
            value: {
                name: string;
                /**
                 * Format: color-hex
                 * @description The hex code of the color (e.g., #000000).
                 */
                hexcode: string;
            }[];
        };
        /** ColorOption */
}

OpenAPI Schema

json
{
  "title": "ColorAttribute",
  "description": "Attribute for colors",
  "type": "object",
  "readOnly": true,
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/ColorAttribute",
    "description": "API reference for the ColorAttribute schema"
  },
  "required": [
    "id",
    "name",
    "key",
    "type",
    "value"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "key": {
      "description": "A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`",
      "type": "string"
    },
    "type": {
      "type": "string",
      "example": "color"
    },
    "value": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "hexcode"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "hexcode": {
            "description": "The hex code of the color (e.g., #000000).",
            "type": "string",
            "format": "color-hex",
            "pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
          }
        }
      }
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: