mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
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:
1 file changed
+1
-3
@@ -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}`);
|
||||
|
||||
Reference in new issue
Block a user