Skip to content

Commit

Permalink
chore: test run for the workflow
Browse files Browse the repository at this point in the history
Changes:
- add process.exit(1) at appropriate locations
  • Loading branch information
AnimeshKumar923 committed Jul 5, 2024
1 parent c60f9ba commit cf8c615
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion scripts/validation/embedded-examples-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function extractCommentsAndExamples(content) {
});
} catch (e) {
console.error("Failed to parse comment JSON or example:", match[1], e);
process.exit(1);
}
}

Expand Down Expand Up @@ -71,6 +72,7 @@ function applyUpdates(updates, baseDoc) {

} catch (e) {
console.error(`\nError processing update for '${update.name}' at path '${update.json_pointer}'`, e);
process.exit(1);
}
});
return baseDoc;
Expand All @@ -85,15 +87,18 @@ async function validateParser(document, name) {
diagnostics.forEach(diagnostic => {
if (diagnostic.level === 'error') {
console.error(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`);
process.exit(1);
} else {
console.log(`\x1b[31mWarning in ${name}: ${diagnostic.message}\x1b[0m`);
console.log(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`);
process.exit(1);
}
});
} else {
console.log(`${name} is valid.`);
}
} catch (error) {
console.error(`\x1b[31mValidation failed for ${name}: ${error.message}\x1b[0m`);
process.exit(1);
}
}

Expand All @@ -119,4 +124,5 @@ Promise.all(validationPromises)
})
.catch((error) => {
console.error('Error during validations:', error);
process.exit(1);
});
2 changes: 1 addition & 1 deletion spec/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ Example using Avro to define the payload:
"payload": {
"schemaFormat": "application/vnd.apache.avro+json;version=1.9.0",
"schema": {
"$ref": "./user-create.avsc"
"$ref": "../user-create.avsc"
}
}
}
Expand Down

0 comments on commit cf8c615

Please sign in to comment.