You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Clemens Vasters (Jira)" <ji...@apache.org> on 2024/03/04 09:45:00 UTC

[jira] [Created] (AVRO-3953) C# CodeGen.cs:503 incorrectly throws for "reserved keywords"

Clemens Vasters created AVRO-3953:
-------------------------------------

             Summary: C# CodeGen.cs:503 incorrectly throws for "reserved keywords"
                 Key: AVRO-3953
                 URL: https://issues.apache.org/jira/browse/AVRO-3953
             Project: Apache Avro
          Issue Type: Bug
          Components: csharp
    Affects Versions: 1.11.3
         Environment: Any use of the C# generator with enums that contain reserved keywords
            Reporter: Clemens Vasters


The C# CodeGen.cs incorrectly chooses to throw when it encounters a C# reserved keyword as an enum member. 

In C#, any identifier that clashes with a reserved keyword can be escaped with a leading '@', e.g. this works:

enum Foo
{
    @string = 1,
    @int = 2,
    @float = 3
}

This is a pretty serious issue with any Avro schema that describes programming-related structures. 



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