{"record":{"id":"d3656e98e5812a7d","repo":"Humanizr/Humanizer","slug":"phrase-section-path-defines-unsupported-proper","errorCode":null,"errorMessage":"Phrase section '{path}' defines unsupported property '{key}'. Supported properties: {allowedKeys}.","messagePattern":"Phrase section '(.+?)' defines unsupported property '(.+?)'\\. Supported properties: (.+?)\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/LocalePhraseNormalization.cs","lineNumber":551,"sourceCode":"\n            return text;\n        }\n\n        static IEnumerable<string> GetPlaceholderNames(string text) =>\n            PlaceholderRegex.Matches(text)\n                .Cast<Match>()\n                .Select(static match => match.Groups[\"name\"].Value);\n\n        static SimpleYamlMapping ExpectMapping(SimpleYamlValue value, string path) =>\n            value as SimpleYamlMapping ??\n            throw new InvalidOperationException($\"Phrase section '{path}' must be a mapping.\");\n\n        static void RejectUnknownKeys(SimpleYamlMapping mapping, string path, params string[] allowedKeys)\n        {\n            foreach (var key in mapping.Values.Keys.Where(key => !allowedKeys.Contains(key, StringComparer.Ordinal)))\n            {\n                throw new InvalidOperationException(\n                    $\"Phrase section '{path}' defines unsupported property '{key}'. Supported properties: {string.Join(\", \", allowedKeys)}.\");\n            }\n        }\n    }\n}","sourceCodeStart":533,"sourceCodeEnd":555,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/LocalePhraseNormalization.cs#L533-L555","documentation":"Thrown by RejectUnknownKeys when a phrase mapping contains a key that is not in the allowed set for that section. Each section closes its property list (e.g. dataUnits unit allows forms/default/zero/singular/dual/paucal/plural/many/symbol/template) to catch typos and schema drift. Surfaced as compiler diagnostic HSG003 (severity Error).","triggerScenarios":"Adding an unsupported property such as 'count' to a data-unit phrase, 'name' to a forms block, or a typo like 'symobl' to any phrase mapping.","commonSituations":"Author invents a property not in the schema; typo in a known key; copy-paste from a different section whose keys are not valid here; leftover experimental field.","solutions":["Read the diagnostic: it names the unsupported key and lists the supported properties for that path.","Remove the unsupported key, or rename it to the correct supported one.","If the value was meant for a different section, move it there.","Rebuild to confirm the diagnostic clears."],"exampleFix":"# before\ndataUnits:\n  byte:\n    symobl: B\n    forms:\n      default: bytes\n# after\ndataUnits:\n  byte:\n    symbol: B\n    forms:\n      default: bytes","handlingStrategy":"validation","validationCode":"# Compare the keys present in each phrase mapping against its allow-list.\n# Example for dataUnits units (allowed: forms,default,zero,singular,dual,paucal,plural,many,symbol,template):\nallowed=[forms default zero singular dual paucal plural many symbol template]\nyq -o=json '.phrases.dataUnits | to_entries[] | .value | select(tag==\"!!map\") | keys | map(select(. as $k | $allowed | index($k) | not))' src/Humanizer/Locales/<code>.yml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the per-section allow-list (printed in the HSG003 message) at hand.","Run a YAML lint/schema check before building.","Build after adding any new key."],"tags":["humanizer","source-generator","locale","yaml","localization","phrases","unknown-key","schema"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}