You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "Alexander Rosenfeld (Jira)" <ji...@apache.org> on 2023/05/02 14:43:00 UTC

[jira] [Updated] (AVRO-3739) Avro code generation for C# doesn't support references to types across files

     [ https://issues.apache.org/jira/browse/AVRO-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Rosenfeld updated AVRO-3739:
--------------------------------------
    Description: 
Hi Apache Avro maintainers, thanks in advance for reviewing this. I'm using the [https://www.nuget.org/packages/Apache.Avro] package (and also the `avrogen` C# tool) to generate C# classes from my Avro schemas. I have a few common building blocks to these schemas (common things like Enum definitions that get used in multiple places across multiple files). I'd like to DRY them by defining them once and _referencing_ them many times, instead of defining them everywhere I need to use them.

 

I understand this behavior is possible with Avro in general. It also appears that the JVM side of things supports this behavior through and through. However, when I try to generate C# from Avro schema files that have this multi-file connectivity, I get errors about not being able to resolve / find the type.

 

There's some discussion about this [here|https://github.com/confluentinc/confluent-kafka-dotnet/issues/1127], but it's inconclusive.

 

I have posted a question on StackOverflow about this, it provides some example JSON and C# for what I'm trying to do: [https://stackoverflow.com/questions/76065680/avro-c-sharp-generate-classes-using-types-defined-across-multiple-schema-files]

 

ps. apologies if the priority is not right. I wasn't sure how to label this, so I left it at the default. This is a pretty big missing feature to me.

  was:
Hi Apache Avro maintainers, thanks in advance for reviewing this. I'm using the [https://www.nuget.org/packages/Apache.Avro] package (and also the `avrogen` C# tool) to generate C# classes from my Avro schemas. I have a few common building blocks to these schemas (common things like Enum definitions that get used in multiple places across multiple files). I'd like to DRY them by defining them once and _referencing_ them many times, instead of defining them everywhere I need to use them.

 

I understand this behavior is possible with Avro in general. It also appears that the JVM side of things supports this behavior through and through. However, when I try to generate C# from Avro schema files that have this multi-file connectivity, I get errors about not being able to resolve / find the type.

 

I have posted a question on StackOverflow about this, it provides some example JSON and C# for what I'm trying to do: [https://stackoverflow.com/questions/76065680/avro-c-sharp-generate-classes-using-types-defined-across-multiple-schema-files]

 

ps. apologies if the priority is not right. I wasn't sure how to label this, so I left it at the default. This is a pretty big missing feature to me.


> Avro code generation for C# doesn't support references to types across files
> ----------------------------------------------------------------------------
>
>                 Key: AVRO-3739
>                 URL: https://issues.apache.org/jira/browse/AVRO-3739
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp
>            Reporter: Alexander Rosenfeld
>            Priority: Major
>
> Hi Apache Avro maintainers, thanks in advance for reviewing this. I'm using the [https://www.nuget.org/packages/Apache.Avro] package (and also the `avrogen` C# tool) to generate C# classes from my Avro schemas. I have a few common building blocks to these schemas (common things like Enum definitions that get used in multiple places across multiple files). I'd like to DRY them by defining them once and _referencing_ them many times, instead of defining them everywhere I need to use them.
>  
> I understand this behavior is possible with Avro in general. It also appears that the JVM side of things supports this behavior through and through. However, when I try to generate C# from Avro schema files that have this multi-file connectivity, I get errors about not being able to resolve / find the type.
>  
> There's some discussion about this [here|https://github.com/confluentinc/confluent-kafka-dotnet/issues/1127], but it's inconclusive.
>  
> I have posted a question on StackOverflow about this, it provides some example JSON and C# for what I'm trying to do: [https://stackoverflow.com/questions/76065680/avro-c-sharp-generate-classes-using-types-defined-across-multiple-schema-files]
>  
> ps. apologies if the priority is not right. I wasn't sure how to label this, so I left it at the default. This is a pretty big missing feature to me.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)