{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/foundryims-com/json-schema/foundryims-com-storefront-category-node-dto-schema.json",
  "title": "StorefrontCategoryNodeDto",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/foundryims-com-openapi.json#/components/schemas/StorefrontCategoryNodeDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "slug": {
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "type": "string"
    },
    "parentId": {
      "type": [
        "string",
        "null"
      ]
    },
    "position": {
      "type": "number",
      "description": "Configured merchandised sort order within siblings (lower = earlier). Nodes and children arrays are already returned in this order."
    },
    "children": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StorefrontCategoryNodeDto"
      }
    },
    "description1": {
      "type": [
        "string",
        "null"
      ],
      "description": "Rich-text (HTML) description. Present only with ?expand=true."
    },
    "description2": {
      "type": [
        "string",
        "null"
      ],
      "description": "Rich-text (HTML) description. Present only with ?expand=true."
    },
    "metaTitle": {
      "type": "string",
      "description": "Resolved SEO <title>; falls back to the category name when unset. Present only with ?expand=true."
    },
    "metaDescription": {
      "type": "string",
      "description": "Resolved SEO meta description; falls back to an excerpt of description1 when unset. Present only with ?expand=true."
    },
    "customFields": {
      "description": "Category custom fields flagged visible on storefront. Present only with ?expand=true.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/StorefrontCustomFieldDto"
      }
    }
  },
  "required": [
    "id",
    "slug",
    "name",
    "parentId",
    "position",
    "children"
  ],
  "$defs": {
    "StorefrontCategoryNodeDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "parentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "position": {
          "type": "number",
          "description": "Configured merchandised sort order within siblings (lower = earlier). Nodes and children arrays are already returned in this order."
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StorefrontCategoryNodeDto"
          }
        },
        "description1": {
          "type": [
            "string",
            "null"
          ],
          "description": "Rich-text (HTML) description. Present only with ?expand=true."
        },
        "description2": {
          "type": [
            "string",
            "null"
          ],
          "description": "Rich-text (HTML) description. Present only with ?expand=true."
        },
        "metaTitle": {
          "type": "string",
          "description": "Resolved SEO <title>; falls back to the category name when unset. Present only with ?expand=true."
        },
        "metaDescription": {
          "type": "string",
          "description": "Resolved SEO meta description; falls back to an excerpt of description1 when unset. Present only with ?expand=true."
        },
        "customFields": {
          "description": "Category custom fields flagged visible on storefront. Present only with ?expand=true.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/StorefrontCustomFieldDto"
          }
        }
      },
      "required": [
        "id",
        "slug",
        "name",
        "parentId",
        "position",
        "children"
      ]
    },
    "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"
      ]
    }
  }
}