-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add Apache Avro schema interface types #40
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 <[email protected]>
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.
Create .github/copilot-instructions.md file with contents:
- Do not add trivial comments, usually do not add blank lines inside functions.
- Use Angular style commits, e.g `feat: implemented xyz`.
- Make sure tests (`yarn test`) pass.
- In the end, make sure linter and formatter pass.
src/avro/types.ts
Outdated
| } | ||
|
|
||
| // Type guard functions for schema type checking | ||
| export function isAvroNullSchema(schema: AvroSchema): schema is AvroNullSchema { |
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.
Remove all functions from this file, only types here.
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.
Removed all functions from the types file, keeping only type definitions. Commit: a431b5d
Co-authored-by: streamich <[email protected]>
Created |
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.
LGTM
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.
Run formatter and linter. Make sure they pass.
Co-authored-by: streamich <[email protected]>
Ran prettier formatter and tslint successfully. All tests pass. Commit: 59b853c |
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR implements TypeScript interfaces for Apache Avro schema types based on the Apache Avro 1.12.0 specification. The implementation provides comprehensive type definitions for all Avro schema types including primitive types, complex types, and logical types.
What's Added
New file:
src/avro/types.tsThe implementation includes:
Primitive Schema Types
AvroNullSchema,AvroBooleanSchema,AvroIntSchema,AvroLongSchemaAvroFloatSchema,AvroDoubleSchema,AvroBytesSchema,AvroStringSchemaComplex Schema Types
AvroRecordSchemawithAvroRecordFieldinterface for structured dataAvroEnumSchemafor enumerated valuesAvroArraySchemaandAvroMapSchemafor collectionsAvroUnionSchemafor union typesAvroFixedSchemafor fixed-length binary dataLogical Types
Extended types built on primitives:
AvroDateLogicalType,AvroTimeMillisLogicalType,AvroTimestampMillisLogicalType, etc.AvroDecimalLogicalTypewith precision and scaleAvroUuidLogicalTypefor UUID stringsAvroDurationLogicalTypefor time durationsUnion Types
AvroPrimitiveSchema,AvroComplexSchema,AvroNamedSchemaAvroSchemaunion type encompassing all schema typesNew file:
.github/copilot-instructions.mdContains coding guidelines for the project including commit style and quality requirements.
All interfaces follow the official Apache Avro specification and include proper TypeScript typing with JSDoc documentation. The types support both object-style schemas and string shorthand notation as defined in the Avro spec.
Fixes #39.
💡 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.