-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement Apache Avro decoders #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
streamich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use beforeEach. To setup a testbed, create a helper function like setup:
const setup = () => {
writer = new Writer();
encoder = new AvroSchemaEncoder(writer);
decoder = new AvroSchemaDecoder();
return {writer, encoder, decoder};
};Make sure linter and formatter pass.
| beforeEach(() => { | ||
| writer = new Writer(); | ||
| encoder = new AvroSchemaEncoder(writer); | ||
| decoder = new AvroSchemaDecoder(); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use beforeEach. To setup a testbed, create a helper function like setup:
| beforeEach(() => { | |
| writer = new Writer(); | |
| encoder = new AvroSchemaEncoder(writer); | |
| decoder = new AvroSchemaDecoder(); | |
| }); | |
| const setup = () => { | |
| writer = new Writer(); | |
| encoder = new AvroSchemaEncoder(writer); | |
| decoder = new AvroSchemaDecoder(); | |
| return {writer, encoder, decoder}; | |
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit e27ae53. Replaced beforeEach with the suggested setup() helper function pattern. All 28 tests in AvroSchemaDecoder.spec.ts now use const {encoder, decoder} = setup() instead of relying on beforeEach.
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Fixed in commit e27ae53. Replaced |
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR implements two Apache Avro decoder classes to complement the existing encoder functionality:
AvroDecoder (Lower-level)
A low-level decoder that implements the
BinaryJsonDecoderinterface and provides methods for decoding specific Avro data types when the schema is known implicitly. Features include:AvroSchemaDecoder (Higher-level)
A schema-aware decoder that uses
AvroDecoderinternally and provides validation against Avro schemas. Features include:AvroSchemaEncoderImplementation Details
Readerclass from@jsonjoy.com/utilfor binary data readingUsage Example
Fixes #38.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.