{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/foundryims-com/json-schema/foundryims-com-storefront-nav-node-dto-schema.json",
  "title": "StorefrontNavNodeDto",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/foundryims-com-openapi.json#/components/schemas/StorefrontNavNodeDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "CATEGORY",
        "LINK",
        "GROUP"
      ],
      "description": "CATEGORY nodes have a slug that resolves against /storefront/categories/:slug; LINK nodes carry an href for the storefront to render; GROUP nodes are non-clickable headings."
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": [
        "string",
        "null"
      ]
    },
    "href": {
      "type": [
        "string",
        "null"
      ]
    },
    "openInNewTab": {
      "type": "boolean"
    },
    "position": {
      "type": "number",
      "description": "Sort order within siblings (lower = earlier). Nodes and children arrays are already returned in this order."
    },
    "productCount": {
      "type": [
        "number",
        "null"
      ],
      "description": "CATEGORY nodes: number of products listed on this storefront under the node (its categories plus their descendants). Always ≥1 for returned nodes unless the node is kept only as a parent of non-empty children. null for LINK and GROUP nodes."
    },
    "children": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StorefrontNavNodeDto"
      }
    }
  },
  "required": [
    "id",
    "type",
    "name",
    "slug",
    "href",
    "openInNewTab",
    "position",
    "productCount",
    "children"
  ],
  "$defs": {
    "StorefrontNavNodeDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "CATEGORY",
            "LINK",
            "GROUP"
          ],
          "description": "CATEGORY nodes have a slug that resolves against /storefront/categories/:slug; LINK nodes carry an href for the storefront to render; GROUP nodes are non-clickable headings."
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "href": {
          "type": [
            "string",
            "null"
          ]
        },
        "openInNewTab": {
          "type": "boolean"
        },
        "position": {
          "type": "number",
          "description": "Sort order within siblings (lower = earlier). Nodes and children arrays are already returned in this order."
        },
        "productCount": {
          "type": [
            "number",
            "null"
          ],
          "description": "CATEGORY nodes: number of products listed on this storefront under the node (its categories plus their descendants). Always ≥1 for returned nodes unless the node is kept only as a parent of non-empty children. null for LINK and GROUP nodes."
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StorefrontNavNodeDto"
          }
        }
      },
      "required": [
        "id",
        "type",
        "name",
        "slug",
        "href",
        "openInNewTab",
        "position",
        "productCount",
        "children"
      ]
    }
  }
}