{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "export": {
      "description": "Path to the Yaak export. Defaults to yaakdoc.json, then yaak.json.",
      "type": "string"
    },
    "theme": {
      "default": "kiseki",
      "description": "Theme to use: a short name (`kiseki` → @yaakdoc/theme-kiseki or yaakdoc-theme-kiseki), an npm package name, or a local path (e.g. an ejected theme).",
      "type": "string"
    },
    "themeOptions": {
      "default": {},
      "description": "Theme-specific options, validated by the theme.",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "workspace": {
      "description": "Workspace id or name to document, when the export contains several.",
      "type": "string"
    },
    "environment": {
      "description": "Environment (id or name) used to resolve variables in examples. Defaults to the first shared environment; `false` disables sub environments.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "boolean",
          "const": false
        }
      ]
    },
    "environments": {
      "description": "Environments readers can switch between: `\"public\"` (all shared environments) or a list of ids/names. Adds an environment switcher; `environment` is the default selection.",
      "anyOf": [
        {
          "type": "string",
          "const": "public"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "pagesDir": {
      "description": "Directory of Markdown pages (`.md`, with optional front matter). Subdirectories become groups in the generated navigation.",
      "type": "string"
    },
    "navigation": {
      "type": "object",
      "properties": {
        "tabs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "tab": {
                "type": "string",
                "description": "Title of the tab."
              },
              "icon": {
                "type": "string",
                "description": "Icon hint for themes (e.g. a Lucide icon name)."
              },
              "pages": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              "groups": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/NavigationGroup"
                }
              },
              "api": {
                "description": "Add the Yaak folders and requests after the tab's pages and groups.",
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "tab"
            ],
            "description": "A top-level section with its own sidebar navigation."
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NavigationGroup"
          }
        },
        "pages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        }
      },
      "description": "Navigation of the pages and the API reference, with optional tabs and groups. Place the Yaak folders and requests with `{ \"api\": true }` (or `api: true` on a tab or group); otherwise they're added at the end. Generated from the pages directory when omitted."
    },
    "apiPath": {
      "description": "Where the API reference (overview, folders and requests) is served, relative to `base`. Defaults to the site root, or `\"reference\"` when the pages directory has an `index.md`.",
      "type": "string"
    },
    "search": {
      "default": true,
      "description": "Generate a search index and show the search dialog.",
      "type": "boolean"
    },
    "pages": {
      "default": "single",
      "description": "`single`: one page with anchors. `per-request`: a page per request and folder.",
      "type": "string",
      "enum": [
        "single",
        "per-request"
      ]
    },
    "base": {
      "description": "Base path the site is served from, e.g. `/docs/`.",
      "default": "/",
      "type": "string"
    },
    "outDir": {
      "default": "dist",
      "description": "Output directory for `yaakdoc build`.",
      "type": "string"
    },
    "server": {
      "default": {},
      "type": "object",
      "properties": {
        "port": {
          "default": 4000,
          "type": "integer",
          "minimum": 0,
          "maximum": 65535
        },
        "host": {
          "default": false,
          "type": [
            "boolean",
            "string"
          ]
        },
        "open": {
          "default": false,
          "type": "boolean"
        }
      }
    },
    "branding": {
      "default": {},
      "type": "object",
      "properties": {
        "title": {
          "description": "Site title. Defaults to the workspace name.",
          "type": "string"
        },
        "description": {
          "description": "Short site description (meta tags, llms.txt). Defaults to the workspace description's first paragraph.",
          "type": "string"
        },
        "url": {
          "description": "Public URL of the deployed docs. Enables absolute links, canonical URLs and sitemap.xml.",
          "type": "string",
          "format": "uri"
        },
        "logo": {
          "anyOf": [
            {
              "type": "string",
              "description": "Path or URL of the logo (used in both color modes)."
            },
            {
              "type": "object",
              "properties": {
                "light": {
                  "description": "Logo used in light mode.",
                  "type": "string"
                },
                "dark": {
                  "description": "Logo used in dark mode.",
                  "type": "string"
                },
                "alt": {
                  "type": "string"
                },
                "href": {
                  "description": "Where clicking the logo leads. Defaults to the docs home.",
                  "type": "string"
                },
                "width": {
                  "type": "number"
                },
                "height": {
                  "type": "number"
                }
              }
            }
          ]
        },
        "favicon": {
          "description": "Path or URL of the favicon.",
          "type": "string"
        },
        "colors": {
          "type": "object",
          "properties": {
            "primary": {
              "type": "string",
              "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
            },
            "accent": {
              "type": "string",
              "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
            },
            "light": {
              "type": "object",
              "properties": {
                "primary": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                },
                "accent": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                },
                "background": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                },
                "foreground": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                }
              },
              "description": "Color overrides that apply to a single color mode."
            },
            "dark": {
              "type": "object",
              "properties": {
                "primary": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                },
                "accent": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                },
                "background": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                },
                "foreground": {
                  "type": "string",
                  "description": "Any CSS color, e.g. `#7c3aed`, `oklch(0.6 0.2 290)` or `rebeccapurple`."
                }
              },
              "description": "Color overrides that apply to a single color mode."
            }
          }
        },
        "fonts": {
          "type": "object",
          "properties": {
            "sans": {
              "description": "CSS font-family for text, e.g. `\"Inter\", sans-serif`.",
              "type": "string"
            },
            "mono": {
              "description": "CSS font-family for code.",
              "type": "string"
            },
            "stylesheet": {
              "description": "Stylesheet URL that loads the fonts, e.g. a Google Fonts CSS URL.",
              "type": "string"
            }
          }
        },
        "links": {
          "default": [],
          "description": "Links shown in the header.",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "href": {
                "type": "string"
              },
              "icon": {
                "description": "Icon hint for themes, e.g. `github`, `discord`, `x`, `website`.",
                "type": "string"
              }
            },
            "required": [
              "label",
              "href"
            ]
          }
        },
        "footer": {
          "description": "Footer text (Markdown).",
          "type": "string"
        },
        "defaultColorMode": {
          "default": "system",
          "type": "string",
          "enum": [
            "system",
            "light",
            "dark"
          ]
        },
        "colorModeToggle": {
          "default": true,
          "description": "Show the light/dark mode toggle.",
          "type": "boolean"
        },
        "customCss": {
          "description": "Path to a CSS file loaded after the theme's styles.",
          "type": "string"
        }
      }
    },
    "snippets": {
      "default": [
        "curl",
        "javascript",
        "python",
        "go",
        "grpcurl",
        "wscat"
      ],
      "description": "Code example generators: built-in ids (curl, javascript, python, go, grpcurl, wscat) or module paths. Each snippet only applies to the request kinds it supports.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "llms": {
      "default": {},
      "type": "object",
      "properties": {
        "enabled": {
          "default": true,
          "description": "Generate llms.txt and Markdown versions of pages.",
          "type": "boolean"
        },
        "full": {
          "default": true,
          "description": "Also generate llms-full.txt with the complete docs.",
          "type": "boolean"
        },
        "copyButton": {
          "default": true,
          "description": "Show \"Copy page\" actions.",
          "type": "boolean"
        },
        "openIn": {
          "default": [
            "chatgpt",
            "claude"
          ],
          "description": "\"Open in ...\" assistant links.",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "chatgpt",
              "claude",
              "perplexity"
            ]
          }
        }
      }
    },
    "variables": {
      "default": {},
      "type": "object",
      "properties": {
        "resolve": {
          "default": true,
          "description": "Inline variable values in examples.",
          "type": "boolean"
        },
        "hide": {
          "default": [
            "token",
            "secret",
            "password",
            "passwd",
            "apikey",
            "api_key",
            "private",
            "credential",
            "auth"
          ],
          "description": "Variable name patterns that are never inlined (case- and separator-insensitive substring match).",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "show": {
          "default": true,
          "description": "Show the environment variables table.",
          "type": "boolean"
        }
      }
    },
    "filter": {
      "description": "Glob patterns over request/folder slugs (e.g. `internal/**`).",
      "default": {},
      "type": "object",
      "properties": {
        "include": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclude": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "runInYaak": {
      "default": false,
      "description": "Show a \"Run in Yaak\" button that imports the API into Yaak. Publishes a sanitized copy of the export (only documented requests, no private environments, secrets blanked).",
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "description": "Name shown in Yaak when importing. Defaults to the site title.",
              "type": "string"
            },
            "url": {
              "description": "URL of an export/spec hosted elsewhere. When omitted, yaakdoc publishes a sanitized export at `<base>/yaak.json`.",
              "type": "string"
            }
          }
        }
      ]
    },
    "head": {
      "default": [],
      "description": "Extra tags injected into <head> (analytics, verification meta tags...).",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tag": {
            "type": "string",
            "enum": [
              "script",
              "link",
              "meta",
              "style"
            ]
          },
          "attrs": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "boolean"
              ]
            }
          },
          "content": {
            "type": "string"
          }
        },
        "required": [
          "tag"
        ]
      }
    }
  },
  "title": "yaakdoc configuration",
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string",
          "description": "Path of a page, relative to `pagesDir`, without the extension (e.g. `guides/auth`)."
        },
        {
          "$ref": "#/$defs/NavigationGroup"
        },
        {
          "type": "object",
          "properties": {
            "api": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "api"
          ],
          "description": "Where the Yaak folders and requests (the API reference) appear."
        }
      ]
    },
    "NavigationGroup": {
      "type": "object",
      "properties": {
        "group": {
          "type": "string",
          "description": "Title of the group."
        },
        "icon": {
          "type": "string",
          "description": "Icon hint for themes (e.g. a Lucide icon name)."
        },
        "expanded": {
          "description": "Whether a nested group starts expanded (default: true).",
          "type": "boolean"
        },
        "pages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "api": {
          "description": "Add the Yaak folders and requests after the group's pages.",
          "type": "boolean",
          "const": true
        }
      },
      "required": [
        "group"
      ],
      "description": "A titled group of pages (groups can be nested)."
    }
  },
  "$id": "https://unpkg.com/yaakdoc/config.schema.json"
}
