{"record":{"id":"663d3dfd91f7f3e8","repo":"Humanizr/Humanizer","slug":"locale-localecode-headings-defines-unsupported","errorCode":null,"errorMessage":"Locale '{localeCode}.headings' defines unsupported property '{property}'. Supported properties: full, short.","messagePattern":"Locale '(.+?)\\.headings' defines unsupported property '(.+?)'\\. Supported properties: full, short\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/LocaleYamlCatalog.cs","lineNumber":792,"sourceCode":"        }\n\n        static HeadingSet? ResolveHeadings(\n            string localeCode,\n            ImmutableDictionary<string, SimpleYamlValue> features)\n        {\n            if (!features.TryGetValue(\"headings\", out var headingValue))\n            {\n                return null;\n            }\n\n            if (headingValue is not SimpleYamlMapping mapping)\n            {\n                throw new InvalidOperationException($\"Locale '{localeCode}.headings' must be a mapping.\");\n            }\n\n            foreach (var property in mapping.Values.Keys.Where(static property => property is not (\"full\" or \"short\")))\n            {\n                throw new InvalidOperationException(\n                    $\"Locale '{localeCode}.headings' defines unsupported property '{property}'. Supported properties: full, short.\");\n            }\n\n            return new HeadingSet(\n                ParseHeadingSequence(mapping, \"full\", localeCode),\n                ParseHeadingSequence(mapping, \"short\", localeCode));\n        }\n\n        static SimpleYamlMapping? ResolveCalendar(\n            string localeCode,\n            ImmutableDictionary<string, SimpleYamlValue> features)\n        {\n            return !features.TryGetValue(\"calendar\", out var calendarValue)\n                ? null\n                : calendarValue as SimpleYamlMapping\n                ?? throw new InvalidOperationException($\"Locale '{localeCode}.calendar' must be a mapping.\");\n        }\n","sourceCodeStart":774,"sourceCodeEnd":810,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/LocaleYamlCatalog.cs#L774-L810","documentation":"The headings mapping accepts exactly two property names: 'full' and 'short'. Any additional key is unsupported because the heading set has a fixed schema, and the generator enumerates mapping keys to reject unknown properties early rather than silently ignoring them.","triggerScenarios":"A locale's 'headings:' mapping contains a key other than 'full' or 'short', such as 'medium', 'narrow', or a typo like 'ful'.","commonSituations":"Copy-pasting CLDR-style property names (narrow, medium) that this schema does not support; typos in property names; leftover experimental keys.","solutions":["Remove or rename the unsupported property so only 'full' and 'short' remain.","If a narrower abbreviation is needed, place it under 'short:' and adjust the values.","Double-check spelling: it must be exactly 'full' and 'short'."],"exampleFix":"# before\nheadings:\n  full:\n    - January\n  medium:\n    - Jan\n\n# after\nheadings:\n  full:\n    - January\n  short:\n    - Jan","handlingStrategy":"validation","validationCode":"import yaml, pathlib\nlocales_dir = pathlib.Path('src/Humanizer/Locales')\nallowed = {'full', 'short'}\nfor f in locales_dir.rglob('*.yml'):\n    data = yaml.safe_load(f.read_text())\n    if isinstance(data, dict) and isinstance(data.get('headings'), dict):\n        extra = set(data['headings'].keys()) - allowed\n        if extra:\n            print(f'{f.name}: headings has unsupported keys: {extra}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the headings schema accepts only 'full' and 'short' — no 'medium', 'narrow', or 'wide'.","Avoid copying CLDR property names verbatim into the headings block.","Add a schema lint that flags unknown headings keys."],"tags":["locale","yaml","source-generator","headings","schema"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}