{"record":{"id":"83a48bc7e0358d8f","repo":"Humanizr/Humanizer","slug":"path-classification-has-unsupported-value-un","errorCode":null,"errorMessage":"'{path}.classification' has unsupported value '{unsupported}'. Supported values: distinct, same-as-nominative, not-applicable, unsupported.","messagePattern":"'(.+?)\\.classification' has unsupported value '(.+?)'\\. Supported values: distinct, same-as-nominative, not-applicable, unsupported\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":329,"sourceCode":"        {\n            var path = $\"{localeCode}.durationCases\";\n            return ParseLegacyForTests(localeCode, ExpectMapping(value, path), path);\n        }\n\n        static DurationCaseCatalog ParseLegacyForTests(\n            string localeCode,\n            SimpleYamlMapping mapping,\n            string path)\n        {\n            RejectUnknownKeys(mapping, path, [\"classification\", \"cases\"]);\n\n            var classification = mapping.GetScalar(\"classification\") switch\n            {\n                \"distinct\" => DurationCaseClassification.Distinct,\n                \"same-as-nominative\" => DurationCaseClassification.Invariant,\n                \"not-applicable\" => DurationCaseClassification.NotApplicable,\n                \"unsupported\" => DurationCaseClassification.Unsupported,\n                { } unsupported => throw new InvalidOperationException(\n                    $\"'{path}.classification' has unsupported value '{unsupported}'. \" +\n                    \"Supported values: distinct, same-as-nominative, not-applicable, unsupported.\"),\n                null => throw new InvalidOperationException($\"'{path}' must define 'classification'.\")\n            };\n\n            if (classification != DurationCaseClassification.Distinct)\n            {\n                if (mapping.TryGetValue(\"cases\", out _))\n                {\n                    throw new InvalidOperationException(\n                        $\"'{path}.cases' is only valid when classification is 'distinct'.\");\n                }\n\n                return new DurationCaseCatalog(\n                    localeCode,\n                    classification,\n                    \"nominative\",\n                    classification == DurationCaseClassification.Invariant ? [\"nominative\"] : [],","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L311-L347","documentation":"Thrown by ParseLegacyForTests when the 'classification' scalar in a legacy durationCases block has a value not in the set {distinct, same-as-nominative, not-applicable, unsupported}. The legacy parser uses 'same-as-nominative' (not 'invariant') as the label for locales where all cases share the nominative form.","triggerScenarios":"ParseLegacyForTests reads classification via a switch expression; the { } unsupported pattern catches any non-null string that doesn't match the four known values. For example 'classification: invariant' fails here because the legacy vocabulary uses 'same-as-nominative'.","commonSituations":"A contributor writes 'classification: invariant' (the explicit-format term) in a legacy-format durationCases block. Or a typo like 'classification: Distinct' (wrong casing) or 'classification: same-as-nom' is present. The legacy and explicit parsers use different vocabulary for the same concept.","solutions":["Use 'same-as-nominative' instead of 'invariant' in legacy-format durationCases blocks.","Double-check spelling and casing: the values are lowercase and hyphenated (e.g. 'not-applicable', not 'NotApplicable').","If you want to use 'invariant', switch to the explicit format by adding inventory/sources/provenance keys so ParseForTests routes to ParseExplicit."],"exampleFix":"# before (legacy format, wrong vocabulary)\ndurationCases:\n  classification: invariant\n# after (legacy format, correct vocabulary)\ndurationCases:\n  classification: same-as-nominative","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> LegacyClassifications = new(StringComparer.Ordinal)\n{ \"distinct\", \"same-as-nominative\", \"not-applicable\", \"unsupported\" };\n\nstatic bool LegacyClassificationIsValid(string? value) =>\n    value is not null && LegacyClassifications.Contains(value);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Legacy durationCases blocks use 'same-as-nominative', not 'invariant'.","Classification values are lowercase and hyphenated — check spelling and casing.","Keep a reference of legacy vs explicit vocabulary nearby when editing locale files."],"tags":["source-generator","duration-cases","legacy-format","testing","classification"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}