{"record":{"id":"e40355cbb1350c2c","repo":"Humanizr/Humanizer","slug":"path-unsupported-must-be-true","errorCode":null,"errorMessage":"'{path}.unsupported' must be true.","messagePattern":"'(.+?)\\.unsupported' must be true\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":1172,"sourceCode":"\n            var mapping = ExpectMapping(value, path);\n            if (mapping.GetScalar(\"sameAsNominative\") is { } sameAsNominative)\n            {\n                RejectUnknownKeys(mapping, path, [\"sameAsNominative\"]);\n                if (!bool.TryParse(sameAsNominative, out var enabled) || !enabled)\n                {\n                    throw new InvalidOperationException($\"'{path}.sameAsNominative' must be true.\");\n                }\n\n                return new DurationCaseUnit(DurationCaseUnitKind.SameAsNominative, null);\n            }\n\n            if (mapping.GetScalar(\"unsupported\") is { } unsupported)\n            {\n                RejectUnknownKeys(mapping, path, [\"unsupported\"]);\n                if (!bool.TryParse(unsupported, out var enabled) || !enabled)\n                {\n                    throw new InvalidOperationException($\"'{path}.unsupported' must be true.\");\n                }\n\n                return new DurationCaseUnit(DurationCaseUnitKind.Unsupported, null);\n            }\n\n            var phrase = LocalePhraseNormalization.ParseTimeSpanPhrase(value, path);\n            if (phrase.Single is null ||\n                phrase.Multiple?.Forms is null)\n            {\n                throw new InvalidOperationException(\n                    $\"Case overlay '{path}' must explicitly define singular and numeric multiple forms.\");\n            }\n\n            return new DurationCaseUnit(DurationCaseUnitKind.Phrase, phrase);\n        }\n\n        static bool ContainsInheritanceMarker(SimpleYamlValue value) =>\n            value switch","sourceCodeStart":1154,"sourceCodeEnd":1190,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L1154-L1190","documentation":"Mirror of error 102 for the 'unsupported' flag. ParseUnit (DurationCaseModels.cs:1170-1173) accepts 'unsupported' only when it is exactly boolean true. A unit is either explicitly unsupported (true) or it carries a phrase/sameAsNominative; false or non-boolean values are invalid.","triggerScenarios":"unsupported is set to false, a quoted string, or another non-true scalar.","commonSituations":"A contributor marks a unit unsupported then sets 'unsupported: false' to toggle it back — the schema has no false branch, so the key should be removed instead.","solutions":["If the unit is genuinely unsupported, set 'unsupported: true' (plain YAML boolean).","Otherwise remove the unsupported key and provide sameAsNominative: true or a full phrase: block."],"exampleFix":"# before\nyear:\n  unsupported: false\n# after - unit is supported\nyear:\n  sameAsNominative: true","handlingStrategy":"validation","validationCode":"# An unsupported unit must be exactly true\nforeach ($u in $caseUnits.GetEnumerator()) {\n    if ($u.Value -is [hashtable] -and $u.Value.ContainsKey('unsupported') `\n        -and $u.Value.unsupported -ne $true) {\n        throw \"unit '$($u.Key)': unsupported must be true (got $($u.Value.unsupported))\"\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 'unsupported: true' only; to make a unit supported again, delete the key.","Keep unsupported and sameAsNominative mutually exclusive within one unit."],"tags":["source-generator","build-time","localization","yaml","duration-cases","locale-data"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}