{"record":{"id":"ad324c556ac2bff4","repo":"Humanizr/Humanizer","slug":"path-cases-defines-unsupported-non-nominative","errorCode":null,"errorMessage":"'{path}.cases' defines unsupported non-nominative case '{caseName}'.","messagePattern":"'(.+?)\\.cases' defines unsupported non-nominative case '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":368,"sourceCode":"                    classification == DurationCaseClassification.Invariant\n                        ? ImmutableDictionary<string, DurationCaseOverlay>.Empty\n                            .WithComparers(StringComparer.Ordinal)\n                            .Add(\"nominative\", CreateBaseDurationOverlay())\n                        : ImmutableDictionary<string, DurationCaseOverlay>.Empty.WithComparers(StringComparer.Ordinal));\n            }\n\n            if (!mapping.TryGetValue(\"cases\", out var casesValue))\n            {\n                throw new InvalidOperationException($\"Distinct duration cases for '{localeCode}' must define 'cases'.\");\n            }\n\n            var casesMapping = ExpectMapping(casesValue, $\"{path}.cases\");\n            var cases = ImmutableDictionary.CreateBuilder<string, DurationCaseOverlay>(StringComparer.Ordinal);\n            foreach (var caseName in casesMapping.Values.Keys\n                         .OrderBy(static name => name, StringComparer.Ordinal)\n                         .Where(caseName => !Cases.Contains(caseName, StringComparer.Ordinal) || caseName == \"nominative\"))\n            {\n                throw new InvalidOperationException(\n                    $\"'{path}.cases' defines unsupported non-nominative case '{caseName}'.\");\n            }\n\n            foreach (var caseName in Cases\n                         .Where(static caseName => caseName != \"nominative\")\n                         .Where(casesMapping.Values.ContainsKey))\n            {\n                cases[caseName] = ParseCase(casesMapping.Values[caseName], $\"{path}.cases.{caseName}\");\n            }\n\n            if (cases.Count == 0)\n            {\n                throw new InvalidOperationException($\"Distinct duration cases for '{localeCode}' must define at least one case.\");\n            }\n\n            return new DurationCaseCatalog(\n                localeCode,\n                classification,","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L350-L386","documentation":"Thrown by ParseLegacyForTests when the 'cases' mapping defines a key that is either not in the supported Cases list (an unknown grammatical case) or is explicitly named 'nominative' (which is implicit and must not be authored). The supported case names are defined in the Cases array (genitive, dative, accusative, instrumental, etc.).","triggerScenarios":"ParseLegacyForTests filters casesMapping.Values.Keys for entries where (!Cases.Contains(caseName) || caseName == 'nominative') and throws for each match. For example 'cases:\\n  nominative: ...' or 'cases:\\n  myCustomCase: ...' triggers it.","commonSituations":"A contributor adds a 'nominative' entry explicitly not knowing it's always implicit. Or they invent a case name not in the supported list. The nominative base overlay is auto-generated by CreateBaseDurationOverlay, so authoring it is redundant and rejected.","solutions":["Remove any 'nominative' key from the cases mapping — it is implicit and auto-generated.","Replace unknown case names with one from the supported Cases list (see DurationCaseModels.cs:255 for the full list).","If you need a case not in the list, propose adding it to the Cases array first."],"exampleFix":"# before (explicit nominative + unknown case)\ndurationCases:\n  classification: distinct\n  cases:\n    nominative: { ... }\n    myCase: { ... }\n# after (valid case names only, no nominative)\ndurationCases:\n  classification: distinct\n  cases:\n    genitive: { ... }","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> SupportedCases = new(StringComparer.Ordinal)\n{ \"nominative\",\"genitive\",\"dative\",\"accusative\",\"instrumental\",\"prepositional\",\n  \"ablative\",\"comitative\",\"ergative\",\"locative\",\"oblique\",\"partitive\",\"vocative\",\n  \"elative\",\"illative\",\"sociative\",\"terminative\",\"translative\",\"absolutive\",\n  \"additive\",\"inessive\",\"allative\",\"adessive\",\"essive\",\"abessive\",\"equative\",\n  \"directive\",\"lative\",\"benefactive\",\"causal\" };\n\nstatic IEnumerable<string> FindInvalidCaseKeys(SimpleYamlMapping cases) =>\n    cases.Values.Keys.Where(k => k == \"nominative\" || !SupportedCases.Contains(k));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never author a 'nominative' key in cases — it is implicit and auto-generated.","Only use case names from the SupportedCases list.","If you need a new case, add it to the Cases array in DurationCaseModels.cs first."],"tags":["source-generator","duration-cases","legacy-format","testing","grammar"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}