Merge pull request #1453 from PR0M3TH3AN/ai/todo-fix-validate-events-20241026-2239501522645835319

fix(ai): remove stale TODO and optimize validation script (TODO)
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-20 21:39:32 -05:00
commit 6a98c52206
1 file changed
+1 -3
+1 -3
View File
@@ -104,10 +104,8 @@ function validateEvent(type, event) {
if (schema.content) {
if (schema.content.format === "json") {
try {
JSON.parse(event.content);
// TODO: Validate JSON schema fields if defined (schema.content.fields)
const parsed = JSON.parse(event.content);
if (schema.content.fields) {
const parsed = JSON.parse(event.content);
schema.content.fields.forEach(field => {
if (field.required && parsed[field.key] === undefined) {
errors.push(`Missing required content field: ${field.key}`);