avro icon indicating copy to clipboard operation
avro copied to clipboard

AVRO-4094: [C#] Updating mapped namespaces referenced in types

Open Shawson opened this issue 1 year ago • 0 comments

What is the purpose of the change

Fixing AVRO-4094 - The use of namespace mappings currently updates namespaces, but not types that reference the namespace in the type name. This PR resolves that.

Due to the complexity of the type attribute, being either simple strings, arrays or complex types- potentially even nested combinations of the above, I use newtonsoft to build the object and recursively walk properties as opposed to the regex approach used in the namespace replacement. This feels a far more maintainable approach given this level of potential complexity.

Verifying this change

This change added tests and can be verified as follows:

  • Introduced new test GenerateSchemaWithMultipleNamespaceMapping which demonstrates two entities in different namespaces which both have their own unique mappings.

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

Shawson avatar Nov 28 '24 21:11 Shawson