{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/foundryims-com/json-schema/foundryims-com-storefront-category-detail-dto-schema.json",
  "title": "StorefrontCategoryDetailDto",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/foundryims-com-openapi.json#/components/schemas/StorefrontCategoryDetailDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "slug": {
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "type": "string"
    },
    "parentId": {
      "type": [
        "string",
        "null"
      ]
    },
    "description1": {
      "type": [
        "string",
        "null"
      ],
      "description": "Rich-text (HTML) description."
    },
    "description2": {
      "type": [
        "string",
        "null"
      ],
      "description": "Rich-text (HTML) description."
    },
    "metaTitle": {
      "type": "string",
      "description": "Resolved SEO <title>; falls back to the category name when unset."
    },
    "metaDescription": {
      "type": "string",
      "description": "Resolved SEO meta description; falls back to an excerpt of description1 when unset."
    },
    "customFields": {
      "description": "Category custom fields flagged visible on storefront.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/StorefrontCustomFieldDto"
      }
    }
  },
  "required": [
    "id",
    "slug",
    "name",
    "parentId",
    "description1",
    "description2",
    "metaTitle",
    "metaDescription",
    "customFields"
  ],
  "$defs": {
    "StorefrontCustomFieldDto": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Stable machine key."
        },
        "label": {
          "type": "string"
        },
        "value": {
          "type": "object",
          "description": "Typed value (string | number | boolean | array | object)."
        },
        "unit": {
          "type": "string",
          "description": "Display unit (NUMBER fields), omitted when unset."
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "number",
            "boolean",
            "enum",
            "date",
            "url",
            "json"
          ]
        },
        "group": {
          "type": "string",
          "description": "Spec-table section, omitted when ungrouped."
        },
        "displayOrder": {
          "type": "number",
          "description": "Sort order within the spec table."
        }
      },
      "required": [
        "key",
        "label",
        "value",
        "type",
        "displayOrder"
      ]
    }
  }
}