{"record":{"id":"73c37d0c257576f0","repo":"github/spec-kit","slug":"each-template-entry-in-provides-templates-must-b","errorCode":null,"errorMessage":"Each template entry in 'provides.templates' must be a mapping","messagePattern":"Each template entry in 'provides\\.templates' must be a mapping","errorType":"validation","errorClass":"PresetValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":414,"sourceCode":"        # 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\n            # PresetValidationError and so escapes the callers that handle a\n            # malformed manifest. The sibling extension manifest already\n            # rejects a non-string command 'file' via\n            # relative_extension_path_violation().\n            for field in (\"type\", \"name\", \"file\"):\n                if not isinstance(tmpl[field], str):\n                    raise PresetValidationError(\n                        f\"Invalid template {field}: expected a string, \"\n                        f\"got {type(tmpl[field]).__name__}\"","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L396-L432","documentation":"Error \"Each template entry in 'provides.templates' must be a mapping\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/presets/__init__.py:414 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make each provides.templates entry a mapping with type/name/file fields."],"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-15T22:17:37.221Z"}