{"record":{"id":"2c07db3083b3889e","repo":"Humanizr/Humanizer","slug":"path-defines-unsupported-property-key-sup","errorCode":null,"errorMessage":"'{path}' defines unsupported property '{key}'. Supported properties: {string.Join(\", \", supported)}.","messagePattern":"'(.+?)' defines unsupported property '(.+?)'\\. Supported properties: (.+?)\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":1206,"sourceCode":"\n        static bool ContainsInheritanceMarker(SimpleYamlValue value) =>\n            value switch\n            {\n                SimpleYamlScalar scalar => scalar.Value.Contains(\"↑↑↑\", StringComparison.Ordinal),\n                SimpleYamlMapping mapping => mapping.Values.Values.Any(ContainsInheritanceMarker),\n                SimpleYamlSequence sequence => sequence.Items.Any(ContainsInheritanceMarker),\n                _ => false\n            };\n\n        static SimpleYamlMapping ExpectMapping(SimpleYamlValue value, string path) =>\n            value as SimpleYamlMapping\n            ?? throw new InvalidOperationException($\"'{path}' must be a mapping.\");\n\n        static void RejectUnknownKeys(SimpleYamlMapping mapping, string path, IReadOnlyCollection<string> supported)\n        {\n            foreach (var key in mapping.Values.Keys.Where(key => !supported.Contains(key)))\n            {\n                throw new InvalidOperationException(\n                    $\"'{path}' defines unsupported property '{key}'. Supported properties: {string.Join(\", \", supported)}.\");\n            }\n        }\n    }\n}","sourceCodeStart":1188,"sourceCodeEnd":1211,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L1188-L1211","documentation":"RejectUnknownKeys (DurationCaseModels.cs:1202-1208) enforces a closed schema: each mapping may only contain keys from an allow-list (a case allows only 'units'; a unit allows 'sameAsNominative', 'unsupported', or phrase keys). Any unrecognised key — including a typo, or mixing sameAsNominative with an extra field — throws and names the offending key plus the supported set.","triggerScenarios":"A case mapping contains a key other than 'units'; a unit mapping mixes 'sameAsNominative' with another key; a typo like 'suported:' or 'unitsMap:'.","commonSituations":"Leftover experimental keys; copy-paste merging two blocks; misspelled property names; combining mutually-exclusive flags.","solutions":["Remove the unsupported key named in the message.","If the key was meant to carry data, rename it to a supported one for that node (case -> 'units'; unit -> 'sameAsNominative'/'unsupported'/phrase).","Ensure mutually-exclusive flags (sameAsNominative vs unsupported vs phrase) appear alone."],"exampleFix":"# before - typo + extra key\nsecond:\n  sameAsNominative: true\n  pluralForm: 'sekundy'   # unsupported\n# after\nsecond:\n  sameAsNominative: true","handlingStrategy":"validation","validationCode":"# Closed-schema key check for duration-case nodes\n$caseKeys  = @('units')\n$unitFlags = @('sameAsNominative','unsupported')\nfunction Test-Unknown($node, $allowed, $path) {\n    foreach ($k in $node.Keys) { if ($k -notin $allowed) { throw \"'$path' has unsupported key '$k' (allowed: $($allowed -join ', '))\" } }\n}\nTest-Unknown $parsed.durationCases.cases.$case $caseKeys \"$locale.cases.$case\"\nforeach ($u in $parsed.durationCases.cases.$case.units.GetEnumerator()) {\n    Test-Unknown $u.Value $unitFlags \"$locale.cases.$case.units.$($u.Key)\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep only one of sameAsNominative/unsupported/phrase per unit.","Spell property keys exactly; watch for typos like 'suported'.","Run a schema validator over locale YAML before committing."],"tags":["source-generator","build-time","localization","yaml","duration-cases","schema","locale-data"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}