confluentinc / confluentinc/confluent-kafka-javascript
Support for Avro Schema Validation and Custom Error Handling
- Dominant language
- TypeScript
- Stars
- 304
- Forks
- 45
- Avg merge
- 11h 47m
- Merged PRs (30d)
- 5
Description
Hello,
We are using kafkaJS to validate events against Avro schemas with custom error handling using the following code:
```
const latestSchemaId = await registry.getLatestSchemaId(schemaRegistrySubject);
const schema = await registry.getSchema(latestSchemaId);
schema.isValid(event, {
errorHook: (path, value, type) => {
console.log(path, value, type);
},
});
```
I'd like to switch to your library, but it currently doesn't support:
1. Validating events against Avro schemas.
2. Providing a custom error handler (like an errorHook) to access detailed validation error information.
Feature Request:
Please consider adding support for (Avro) schema validation in your registry lib and a way to handle validation errors with detailed context (path, value, type). This would greatly help in managing and logging validation errors effectively.
Thank you for your consideration.
Contributor guide
Assessment
This issue has not been assessed yet.