Skip to content

Conversation

@jtmarks6
Copy link

@jtmarks6 jtmarks6 commented Sep 23, 2024

Summary

Added custom properties like Apache Avro SchemaBuilder has: https://avro.apache.org/docs/1.7.6/api/java/org/apache/avro/SchemaBuilder.html. This will allow schema to contain custom metadata on fields which will greatly increase the use cases of Avro schemas.

Description

All fields now have the method .prop(string, any) which will add a custom property to the field. This is the same syntax and output schema as Apache's SchemaBuilder:

image

Testing

Added unit tests for all types.

Issue

This PR will resolve issue #1

Comment on lines +95 to +98
"customProp": "val",
"name": "enum_field_with_customProp",
"type": {
"customProp": "val",
Copy link
Author

@jtmarks6 jtmarks6 Sep 23, 2024

Choose a reason for hiding this comment

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

Please consider if the custom property should be duplicated here on top and nested level. I thought since the name is duplicated, the custom prop also should be. This also applies to a few other types. (Any that have the nested/duplicate name)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant