ppodgorsek commented on code in PR #3247:
URL: https://github.com/apache/avro/pull/3247#discussion_r1924048746
##########
lang/csharp/src/apache/main/CodeGen/CodeGen.cs:
##########
@@ -1266,5 +1273,103 @@ private static string
ReplaceMappedNamespacesInSchema(string input, IEnumerable<
return
$@"""namespace""{m.Groups[1].Value}:{m.Groups[2].Value}""{ns}""";
});
}
+
+
+
Review Comment:
```suggestion
```
##########
lang/csharp/src/apache/main/CodeGen/CodeGen.cs:
##########
@@ -1266,5 +1273,103 @@ private static string
ReplaceMappedNamespacesInSchema(string input, IEnumerable<
return
$@"""namespace""{m.Groups[1].Value}:{m.Groups[2].Value}""{ns}""";
});
}
+
+
+
+ /// <summary>
+ /// Replace namespaces in a parsed JSON schema object for all "type"
fields.
+ /// </summary>
+ /// <param name="schemaJson">The JSON schema as a string.</param>
+ /// <param name="namespaceMapping">The mapping of old namespaces to new
namespaces.</param>
+ /// <returns>The updated JSON schema as a string.</returns>
+ private static string ReplaceMappedNamespacesInSchemaTypes(string
schemaJson, IEnumerable<KeyValuePair<string, string>> namespaceMapping)
+ {
+ if (string.IsNullOrWhiteSpace(schemaJson) || namespaceMapping == null)
+ return schemaJson;
Review Comment:
```suggestion
if (string.IsNullOrWhiteSpace(schemaJson) || namespaceMapping ==
null)
{
return schemaJson;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]