Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 31, 2025

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.ts

The implementation includes:

Primitive Schema Types

  • AvroNullSchema, AvroBooleanSchema, AvroIntSchema, AvroLongSchema
  • AvroFloatSchema, AvroDoubleSchema, AvroBytesSchema, AvroStringSchema

Complex Schema Types

  • AvroRecordSchema with AvroRecordField interface for structured data
  • AvroEnumSchema for enumerated values
  • AvroArraySchema and AvroMapSchema for collections
  • AvroUnionSchema for union types
  • AvroFixedSchema for fixed-length binary data

Logical Types

Extended types built on primitives:

  • Date/time types: AvroDateLogicalType, AvroTimeMillisLogicalType, AvroTimestampMillisLogicalType, etc.
  • AvroDecimalLogicalType with precision and scale
  • AvroUuidLogicalType for UUID strings
  • AvroDurationLogicalType for time durations

Union Types

  • AvroPrimitiveSchema, AvroComplexSchema, AvroNamedSchema
  • Main AvroSchema union type encompassing all schema types

New file: .github/copilot-instructions.md

Contains 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.

@streamich streamich marked this pull request as ready for review July 31, 2025 21:45
Copilot AI changed the title [WIP] Apache Avro schema interface Add Apache Avro schema interface types Jul 31, 2025
Copilot AI requested a review from streamich July 31, 2025 21:46
Copy link
Collaborator

@streamich streamich left a 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.

}

// Type guard functions for schema type checking
export function isAvroNullSchema(schema: AvroSchema): schema is AvroNullSchema {
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Copilot AI commented Jul 31, 2025

Create .github/copilot-instructions.md file with contents:

Created .github/copilot-instructions.md with the specified coding guidelines. Commit: a431b5d

Copy link
Collaborator

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI requested a review from streamich July 31, 2025 21:56
Copy link
Collaborator

@streamich streamich left a 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.

Copy link
Contributor Author

Copilot AI commented Jul 31, 2025

Run formatter and linter. Make sure they pass.

Ran prettier formatter and tslint successfully. All tests pass. Commit: 59b853c

Copilot AI requested a review from streamich July 31, 2025 22:02
@streamich streamich merged commit 1a42e8b into master Aug 1, 2025
2 checks passed
@streamich streamich deleted the copilot/fix-39 branch August 1, 2025 13:55
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apache Avro schema interface

2 participants