{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-variation-attribute-schema.json",
  "title": "VariationAttribute",
  "description": "Document representing a variation attribute.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-products-api-openapi.yml#/components/schemas/VariationAttribute",
  "required": [
    "attributeDefinitionId"
  ],
  "type": "object",
  "properties": {
    "attributeDefinitionId": {
      "type": "string",
      "description": "The id of the requested attribute definition."
    },
    "attributeDefinitionName": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The localized display name of the variation attribute definition."
    },
    "defaultValue": {
      "type": "string",
      "description": "Default variation attribute value."
    },
    "id": {
      "minLength": 1,
      "type": "string",
      "description": "The ID of the variation attribute."
    },
    "name": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The localized display name of the variation attribute."
    },
    "shared": {
      "type": "boolean",
      "description": "Returns the value of attribute 'shared' if attribute is local or shared."
    },
    "slicing": {
      "type": "boolean",
      "description": "Returns the value of attribute 'slicing'."
    },
    "values": {
      "items": {
        "$ref": "#/$defs/VariationAttributeValue"
      },
      "type": "array",
      "description": "The sorted array of variation values. This array can be empty."
    },
    "variationAttributeType": {
      "type": "string",
      "description": "Variation attribute type.",
      "enum": [
        "string",
        "int",
        "unknown"
      ]
    }
  },
  "$defs": {
    "MediaFile": {
      "required": [
        "path"
      ],
      "type": "object",
      "properties": {
        "absUrl": {
          "type": "string",
          "description": "The absolute URL with request protocol."
        },
        "alt": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The alternative image text."
        },
        "disBaseUrl": {
          "type": "string",
          "description": "The Dynamic Image Service (DIS) base URL for product images only."
        },
        "path": {
          "type": "string",
          "description": "The raw media file path."
        },
        "title": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The image title."
        }
      },
      "description": "Document representing media file."
    },
    "VariationAttributeValue": {
      "required": [
        "value"
      ],
      "type": "object",
      "properties": {
        "description": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The localized description of the variation value."
        },
        "image": {
          "$ref": "#/$defs/MediaFile"
        },
        "imageSwatch": {
          "$ref": "#/$defs/MediaFile"
        },
        "name": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The localized display name of the variation value."
        },
        "orderable": {
          "type": "boolean",
          "description": "A flag indicating whether at least one variant with this variation attribute value is available to sell."
        },
        "position": {
          "type": "number",
          "description": "The position of the value among all values of a variation attribute.",
          "format": "double"
        },
        "value": {
          "minLength": 1,
          "type": "string",
          "description": "The actual variation value."
        }
      },
      "description": "Document representing a variation attribute value."
    }
  }
}