mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 17:02:28 +00:00
chore(ai): remove stale TODO and optimize JSON parsing in validation script
- Removed a TODO comment in `scripts/agent/validate-events.mjs` as the functionality was already implemented. - Optimized the code to avoid redundant `JSON.parse` calls. - Verified the script passes all validation tests. - Created `artifacts/issue_telemetry_json.md` to track the larger task of handling JSON logs in telemetry aggregation.
This commit is contained in:
1 parent
f663b6d6a3
commit
6a4ac5120e
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