Add fixes for complex type schemas, handle inline structs and others#1
Merged
wirelessr merged 5 commits intowirelessr:mainfrom Mar 11, 2025
Merged
Conversation
- For complex types the type field needs to be a fully defined schema, rather than the name of the complex type such as 'array', 'map'. - Add test case for inline structs with json tag.
Add a couple of options: - one to prefer the go field name over any given json/bson name - another to add fields even if there are no json/bson tags
Contributor
Author
|
oops! Hadn't meant to raise against upstream, feel free to take anything useful from here if it helps! |
Owner
|
I feel this PR is great, and I will take more time to read it seriously. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added following fixes/functionality:
Tried to keep things backwards compatible where possible but for the complex record types its definitely changed the schema... I'm unsure what the actual use cases were for these previous schema in reflect_test.go but they weren't 'valid' according to avro-tools or hamba/avro. I believe they now are so should be a positive step for anyone wanting this functionality.