{"record":{"id":"ea563dd7edde7571","repo":"Humanizr/Humanizer","slug":"unsupported-clock-notation-contract-member-kind","errorCode":null,"errorMessage":"Unsupported clock-notation contract member kind '{member.Kind}'.","messagePattern":"Unsupported clock-notation contract member kind '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/TimeOnlyToClockNotationEngineContractFactory.cs","lineNumber":54,"sourceCode":"        /// everything in an unnecessary extra tuple constructor.\n        /// </summary>\n        static string CreateConstructorValues(JsonElement root, ImmutableArray<EngineContractMember> members) =>\n            members.Length == 1 && members[0].Kind == \"profile-object\"\n                ? CreateMemberValue(root, members[0])\n                : \"new(\" + string.Join(\", \", members.Select(member => CreateMemberValue(root, member))) + \")\";\n\n        static string CreateMemberValue(JsonElement root, EngineContractMember member) =>\n            member.Kind switch\n            {\n                \"profile-object\" => CreateObjectValue(root, member),\n                \"string\" => QuoteLiteral(GetStringValue(root, member)),\n                \"enum\" => CreateEnumValue(root, member),\n                \"bool\" => GetBooleanValue(root, member) ? \"true\" : \"false\",\n                \"int32\" => GetInt32Value(root, member).ToString(CultureInfo.InvariantCulture),\n                \"optional-string-array\" => EngineContractUtilities.TryGetElement(root, member.SourcePath, out var optionalArray)\n                    ? CreateStringArrayExpression(optionalArray)\n                    : \"Array.Empty<string>()\",\n                _ => throw new InvalidOperationException($\"Unsupported clock-notation contract member kind '{member.Kind}'.\")\n            };\n\n        static string CreateEnumValue(JsonElement root, EngineContractMember member)\n        {\n            if (member.EnumType is null)\n            {\n                throw new InvalidOperationException(\"Enum members require an enum type.\");\n            }\n\n            return member.EnumType + \".\" + ToEnumMemberName(GetStringValue(root, member));\n        }\n\n        static bool GetBooleanValue(JsonElement root, EngineContractMember member)\n        {\n            if (EngineContractUtilities.TryGetElement(root, member.SourcePath, out var value) &&\n                value.ValueKind is JsonValueKind.True or JsonValueKind.False)\n            {\n                return value.GetBoolean();","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/TimeOnlyToClockNotationEngineContractFactory.cs#L36-L72","documentation":"Thrown during source generation by CreateMemberValue when binding a clock-notation engine contract member whose Kind is not one of the supported values: 'profile-object', 'string', 'enum', 'bool', 'int32', or 'optional-string-array'. The switch's default arm fires for any unrecognized member kind, indicating a mismatch between the engine contract definition and the generator's supported member types.","triggerScenarios":"An engine contract JSON in EngineContractCatalog declares a clock-notation member with a Kind value that the TimeOnlyToClockNotationEngineContractFactory does not handle. This is an internal contract/generator synchronization error, typically introduced when a new member kind is added to the contract schema without updating this factory.","commonSituations":"A Humanizer developer adds a new member kind (e.g. 'double', 'optional-int32') to a clock-notation engine contract but forgets to add the corresponding case in CreateMemberValue. Or a typo in the contract JSON produces an unrecognized kind string.","solutions":["Check the engine contract JSON for the clock-notation engine named in the build error and verify all member Kind values are one of the six supported kinds.","If a new kind is needed, add a case arm in the switch at TimeOnlyToClockNotationEngineContractFactory.cs:44 that emits the correct constructor argument expression.","Fix any typo in the Kind string in the contract definition."],"exampleFix":"// before — contract declares an unsupported kind\n{ \"kind\": \"double\", \"sourcePath\": \"clockNotation.precision\" }\n\n// after — use a supported kind or add a case in the factory\n{ \"kind\": \"int32\", \"sourcePath\": \"clockNotation.precision\" }","handlingStrategy":"validation","validationCode":"// This is an internal contract/generator error. Prevent it by ensuring\n// every clock-notation engine contract member has a Kind value that the\n// factory supports: 'profile-object', 'string', 'enum', 'bool', 'int32',\n// or 'optional-string-array'. If a new kind is needed, add its case to\n// the switch at TimeOnlyToClockNotationEngineContractFactory.cs:44.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When adding a new member kind to a clock-notation engine contract, immediately add the corresponding case in CreateMemberValue.","Keep the supported Kind set documented alongside the contract schema.","Review contract JSON for typos in Kind strings."],"tags":["source-generator","clock-notation","engine-contract","internal","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}