Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3953

C# CodeGen.cs:503 incorrectly throws for "reserved keywords"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.11.3
    • 1.12.0
    • csharp
    • Any use of the C# generator with enums that contain reserved keywords

    Description

      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. 

      Attachments

        Issue Links

          Activity

            People

              zoltan_csizmadia Zoltan Csizmadia
              clemensv Clemens Vasters
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m