{"record":{"id":"58ddc1dec461cbcd","repo":"github/spec-kit","slug":"invalid-preset-field-expected-a-string-got-ty","errorCode":null,"errorMessage":"Invalid preset.{field}: expected a string, got {type(pack[field]).__name__}","messagePattern":"Invalid preset\\.(.+?): expected a string, got (.+?)","errorType":"validation","errorClass":"PresetValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":342,"sourceCode":"\n        # Validate preset metadata\n        pack = self.data[\"preset\"]\n        # Check presence AND type: the format/version checks below feed these\n        # values straight to ``re.match`` and ``packaging.Version``, both of\n        # which raise a bare TypeError on a non-string. YAML makes that an easy\n        # authoring slip -- unquoted ``version: 1.0`` parses as a float and\n        # ``id: 2`` as an int -- and TypeError is not a PresetValidationError,\n        # so it escapes every caller that already handles a malformed manifest\n        # (see list_installed()'s \"Corrupted preset\" fallback, which catches\n        # PresetValidationError only, making one bad preset exit ``specify\n        # preset list`` with a raw traceback and hide the healthy ones).\n        # Mirrors the sibling IntegrationDescriptor, which already type-checks\n        # the same four fields.\n        for field in [\"id\", \"name\", \"version\", \"description\"]:\n            if field not in pack:\n                raise PresetValidationError(f\"Missing preset.{field}\")\n            if not isinstance(pack[field], str):\n                raise PresetValidationError(\n                    f\"Invalid preset.{field}: expected a string, \"\n                    f\"got {type(pack[field]).__name__}\"\n                )\n\n        # Validate pack ID format\n        if not re.match(r'^[a-z0-9-]+$', pack[\"id\"]):\n            raise PresetValidationError(\n                f\"Invalid preset ID '{pack['id']}': \"\n                \"must be lowercase alphanumeric with hyphens only\"\n            )\n\n        # Validate semantic version\n        try:\n            pkg_version.Version(pack[\"version\"])\n        except pkg_version.InvalidVersion:\n            raise PresetValidationError(f\"Invalid version: {pack['version']}\")\n\n        # Validate requires section","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L324-L360","documentation":"Error \"Invalid preset.{field}: expected a string, got {type(pack[field]).__name__}\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/presets/__init__.py:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make preset.<field> a string in the 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-15T22:17:37.221Z"}