Nested static namespace causes SchemaParseException: Can't redefine

Hi,

I have a problem with generating java classes from avro schema with avro-maven-plugin. I get org.apache.avro.SchemaParseException: can't redefine. My schemas is auto registered from cdc with debezium and then inserted to schema registry with AvroConverter.

See this example avro:

{
  "type": "record",
  "name": "Envelope",
  "namespace": "hello.A",
  "fields": [
    {
      "name": "before",
      "type": [
        "null",
        {
          "type": "record",
          "name": "Value",
          "fields": [...],
          "connect.name": "hello.A.Value"
        }
      ],
      "default": null
    },
    {
      "name": "after",
      "type": [
        "null",
        "Value"
      ],
      "default": null
    },
    {
      "name": "source",
      "type": {
        "type": "record",
        "name": "Source",
        "namespace": "io.debezium.connector.mysql", // problem
        "fields": [...],
        "connect.name": "io.debezium.connector.mysql.Source"
      }
    },
    {
      "name": "transaction",
      "type": [
        "null",
        {
          "type": "record",
          "name": "block",
          "namespace": "event", // problem
          "fields": [...],
          "connect.version": 1,
          "connect.name": "event.block"
        }
      ],
      "default": null
    }
  ],
  "connect.version": 1,
  "connect.name": "hello.A.Envelope"
}

When I have multiple table to CDC from I will get more of this type of schema but with another top level namespace (for example hello.B). But the source field and the event.block field will still have the same static namespace(io.debezium.connector.mysql) and will therefore override the top level namespace and cause the SchemaParseException: can't redefine.

I think debezium creates a message without the namespace set. I think the message will just be:

"optional": false,
"name": "io.debezium.connector.mysql.Source", 
"field": "source"

And the the AvroConverter splits the name to name +namespace?

Is there any way to control this or get around it?