{"record":{"id":"44f7477fd6fc8bc8","repo":"larksuite/cli","slug":"event-catalog-rejected","errorCode":null,"errorMessage":"event catalog rejected:\n  ","messagePattern":"event catalog rejected:\n  ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/event/catalog/compile.go","lineNumber":110,"sourceCode":"\t\t\tcapability: Capability{\n\t\t\t\tPreparation:    preparation,\n\t\t\t\tBufferSize:     def.BufferSize,\n\t\t\t\tWorkers:        def.Workers,\n\t\t\t\tSingleConsumer: def.SingleConsumer,\n\t\t\t},\n\t\t\tbinding: RuntimeBinding{\n\t\t\t\tNormalizeParams: def.NormalizeParams,\n\t\t\t\tMatch:           def.Match,\n\t\t\t\tProcess:         def.Process,\n\t\t\t\tPreConsume:      def.PreConsume,\n\t\t\t},\n\t\t\tcanonical: def,\n\t\t}\n\t\tkeys = append(keys, def.Key)\n\t}\n\n\tif len(problems) > 0 {\n\t\treturn nil, errors.New(\"event catalog rejected:\\n  \" + strings.Join(problems, \"\\n  \"))\n\t}\n\n\tsort.Strings(keys)\n\treturn &Snapshot{entries: entries, keys: keys}, nil\n}\n\n// jqRootPath states where consumers address output fields from: native keys\n// deliver the V2 envelope (fields under .event), processed keys deliver the\n// processor's flat shape (fields at the root).\nfunc jqRootPath(mode OutputMode) string {\n\tif mode == OutputNative {\n\t\treturn \".event\"\n\t}\n\treturn \".\"\n}\n\n// validateDefinition runs the per-declaration contract checks. It reports\n// every violation instead of stopping at the first.","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/event/catalog/compile.go#L92-L128","documentation":"This error is produced by Compile when the event catalog has validation problems: all collected problem strings are joined into one aggregated message ('event catalog rejected:\\n  <problem>\\n  <problem>'). Compile is a guard so an invalid or inconsistent catalog (bad declarations, placeholder schemas, credential-redaction violations) never becomes a Snapshot. The message enumerates each concrete problem after a two-space bullet.","triggerScenarios":"Calling event/catalog Compile (including compileCatalog/compileTestSnapshot in tests) with a spec whose declarations fail validation — e.g. schemas that decode to empty/placeholder documents or parameters containing unredacted credentials (see the redaction-guard test).","commonSituations":"Adding a new event declaration with an empty object schema; renaming a field but leaving stale placeholder schemas; registering a bot menu or catalog entry whose params embed raw credential values.","solutions":["Read each bullet line in the error — it lists every failing declaration and reason","Fix the offending spec: give the schema a real Type or Raw, or redact credential-like params","Re-run compile/tests (e.g. TestBotMenuRegistersCleanly) to confirm the catalog is clean"],"exampleFix":"// before\nSchema: &catalog.Schema{} // placeholder: empty document\n// after\nSchema: &catalog.Schema{Type: \"object\", Properties: ...}","handlingStrategy":"validation","validationCode":"snap, err := catalog.Compile(spec)\nif err != nil {\n    for _, problem := range strings.Split(err.Error(), \"\\n  \")[1:] { fmt.Println(problem) }\n}","typeGuard":null,"tryCatchPattern":"snap, err := catalog.Compile(spec)\nif err != nil {\n    // err lists every problem prefixed 'event catalog rejected:' — fix each bullet\n}","preventionTips":["Keep the redaction-guard and compile tests in CI for every catalog change","Never declare placeholder (empty) schemas","Review each bullet in the aggregated error — it names every failing declaration","Run TestBotMenuRegistersCleanly-style compile checks before registering new events"],"tags":["events","catalog","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}