{"record":{"id":"fee3987c8b3f7e1c","repo":"Humanizr/Humanizer","slug":"path-classification-has-unsupported-value-un-fee398","errorCode":null,"errorMessage":"'{path}.classification' has unsupported value '{unsupported}'. Supported values: distinct, invariant, not-applicable, unsupported.","messagePattern":"'(.+?)\\.classification' has unsupported value '(.+?)'\\. Supported values: distinct, invariant, not-applicable, unsupported\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":440,"sourceCode":"\n        static DurationCaseCatalog ParseExplicit(\n            string localeCode,\n            SimpleYamlMapping mapping,\n            string path,\n            ImmutableArray<string> requiredMultipleForms)\n        {\n            RejectUnknownKeys(\n                mapping,\n                path,\n                [\"classification\", \"citationCase\", \"inventory\", \"sources\", \"cases\", \"reason\", \"provenance\"]);\n\n            var classification = mapping.GetScalar(\"classification\") switch\n            {\n                \"distinct\" => DurationCaseClassification.Distinct,\n                \"invariant\" => 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, invariant, not-applicable, unsupported.\"),\n                null => throw new InvalidOperationException($\"'{path}' must define 'classification'.\")\n            };\n\n            var sources = ParseSources(mapping, path);\n            if (classification == DurationCaseClassification.NotApplicable)\n            {\n                var reason = RequireScalar(mapping, \"reason\", path);\n                if (string.IsNullOrWhiteSpace(reason))\n                {\n                    throw new InvalidOperationException($\"'{path}.reason' must not be empty.\");\n                }\n\n                ValidateProvenance(ParseProvenance(mapping, path, required: true), sources, path);\n                if (mapping.TryGetValue(\"inventory\", out _) || mapping.TryGetValue(\"cases\", out _))\n                {\n                    throw new InvalidOperationException(","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L422-L458","documentation":"Thrown by ParseExplicit when the 'classification' scalar in an explicit (release-format) durationCases block has a value not in the set {distinct, invariant, not-applicable, unsupported}. The explicit parser uses 'invariant' (not 'same-as-nominative') as the label for locales where all cases share the nominative form. This is the explicit-format counterpart of error 52.","triggerScenarios":"ParseExplicit's switch expression catches any non-null classification value that doesn't match the four known labels via the { } unsupported pattern. For example 'classification: same-as-nominative' fails here because the explicit vocabulary uses 'invariant'. ParseExplicit is called when the durationCases block has inventory/sources/provenance/reason keys.","commonSituations":"A contributor copies a legacy-format durationCases block (using 'same-as-nominative') and adds inventory/sources keys to convert it to explicit format, but forgets to update the classification vocabulary. Or a typo/casing error is present.","solutions":["Use 'invariant' instead of 'same-as-nominative' in explicit-format durationCases blocks.","Verify the classification value is lowercase and matches exactly: distinct, invariant, not-applicable, or unsupported.","If you need the legacy vocabulary ('same-as-nominative'), remove inventory/sources/provenance keys so ParseForTests routes to ParseLegacyForTests."],"exampleFix":"# before (explicit format, legacy vocabulary)\ndurationCases:\n  classification: same-as-nominative\n  inventory: [nominative]\n  sources: [...]\n# after (explicit format, correct vocabulary)\ndurationCases:\n  classification: invariant\n  inventory: [nominative]\n  sources: [...]","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> ExplicitClassifications = new(StringComparer.Ordinal)\n{ \"distinct\", \"invariant\", \"not-applicable\", \"unsupported\" };\n\nstatic bool ExplicitClassificationIsValid(string? value) =>\n    value is not null && ExplicitClassifications.Contains(value);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Explicit-format durationCases blocks use 'invariant', not 'same-as-nominative'.","When converting from legacy to explicit format, update the classification vocabulary.","Verify the classification value against the explicit set before adding inventory/sources keys."],"tags":["source-generator","duration-cases","explicit-format","classification","release"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}