{"record":{"id":"d5b4fcb50de3e261","repo":"github/spec-kit","slug":"invalid-provides-templates-expected-a-list-d5b4fc","errorCode":null,"errorMessage":"Invalid provides.templates: expected a list","messagePattern":"Invalid provides\\.templates: expected a list","errorType":"validation","errorClass":"PresetValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":405,"sourceCode":"            raise PresetValidationError(\n                \"Preset must provide at least one template\"\n            )\n\n        # Validate templates. Guard the container and each entry's shape so a\n        # malformed third-party preset.yml (e.g. ``templates: 5`` or\n        # ``templates: [null]``) raises a clean PresetValidationError the\n        # install handler already catches, instead of a raw TypeError\n        # ('int'/'NoneType' object is not iterable) that escapes to an\n        # unhandled traceback. Mirrors the sibling ExtensionManifest guards.\n        #\n        # Order matters: the container's TYPE is checked before its emptiness,\n        # so a FALSY non-list (``templates: 0``/``false``/``null``/``''``/``{}``)\n        # reports the accurate type error rather than the misleading \"must\n        # provide at least one template\". An empty list still reports the\n        # latter, since that genuinely is a list with no templates.\n        templates = provides[\"templates\"]\n        if not isinstance(templates, list):\n            raise PresetValidationError(\n                \"Invalid provides.templates: expected a list\"\n            )\n        if not templates:\n            raise PresetValidationError(\n                \"Preset must provide at least one template\"\n            )\n        for tmpl in templates:\n            if not isinstance(tmpl, dict):\n                raise PresetValidationError(\n                    \"Each template entry in 'provides.templates' must be a mapping\"\n                )\n            if \"type\" not in tmpl or \"name\" not in tmpl or \"file\" not in tmpl:\n                raise PresetValidationError(\n                    \"Template missing 'type', 'name', or 'file'\"\n                )\n\n            # 'name' feeds re.match and 'file' feeds os.path.normpath below;\n            # both raise a bare TypeError on a non-string, which is not a","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L387-L423","documentation":"Error \"Invalid provides.templates: expected a list\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/presets/__init__.py:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make provides.templates a list in the preset manifest."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}