Skip to content

Create aliases on the globalNames somehow #120

Description

@rfloriano

Hey,

I'm using the confluent-kafka-go, during the deserialization-generic flow they call avro.Unmarshal, which by consequence it will use the globalNames.Unmarshal.
In my case, I'm experiencing an error of Incompatible types from gogen-avro, I have a struct with the Avro schema defined just on the schema registry, outer from my project. So the writer and reader schemas don't match, because the field names are interpreted differently.

After doing some hacks locally in order to test, I found globalNames.Rename("<struct_field>", "<schema_registry_field>", "<struct_field>") and it solves the issue. But I didn't find a way to hook globalNames variable or some way to replace them globally (as zap log does for instance).

Which is the right way to use the aliases by Rename method?
Does makes sense for you to propose a way to use Rename method on the globalNames? If does, would you accept a PR making this kind of change?

Tks

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions