DavidNeukamXXXLutz opened a new pull request, #3516:
URL: https://github.com/apache/avro/pull/3516
## What is the purpose of the change
*This PR fixes the issue AVRO-4187*
When using avrogen for generating C# models from a schemafile, the
--namespace option doesn't behave as expected.
When running
avrogen -s file.avsc . --namespace my.avro.ns:my.csharp.ns
the namespace within the SCHEMA property of the generated C# files is
changed to my.csharp.ns, but should be left with the value my.avro.ns.
`namespace my.csharp.ns
{
using System;
using System.Collections.Generic;
using System.Text;
using Avro;
using Avro.Specific;
public partial class TestModel : ISpecificRecord
{
public static Schema _SCHEMA =
Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"TestModel\",\"namespace\":\"my.avro.ns\",\"fields\":[{\"name\":\"e"
+
"ventType\",\"type\":{\"type\":\"enum\",\"name\":\"EventType\",\"namespace\":\"my.avro.ns\",\"sym"
+
"bols\":[\"CREATE\",\"UPDATE\",\"DELETE\"]}}]}");
private my.csharp.ns.EventType _eventType;
// More generated code
}
}`
## Verifying this change
This change added tests and can be verified as follows:
- *Extended existing namespace tests to assert that the avro namespace is
contained in the SCHEMA property*
- *Extended existing namespace tests to assert that the csharp namespace is
not contained in the SCHEMA property*
## Documentation
- Does this pull request introduce a new feature? no
--
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]