Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shawson
Copy link

@Shawson Shawson commented Nov 28, 2024

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)

@github-actions github-actions bot added the C# label Nov 28, 2024
@Shawson Shawson marked this pull request as ready for review November 28, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant