[ 
https://issues.apache.org/jira/browse/AVRO-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17039504#comment-17039504
 ] 

Matthew Kellogg commented on AVRO-2750:
---------------------------------------

[https://github.com/apache/avro/pull/820]

> Support for enum defaults in c#
> -------------------------------
>
>                 Key: AVRO-2750
>                 URL: https://issues.apache.org/jira/browse/AVRO-2750
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: csharp
>    Affects Versions: 1.9.2
>            Reporter: Matthew Kellogg
>            Priority: Minor
>
> C# needs to support default enum values as referenced in the 1.9.2 version of 
> the Avro specification.
> For example:
> {code:java}
> {
>   "type": "enum",
>   "name": "Test",
>   "symbols": [
>     "Unknown",
>     "A",
>     "B"
>   ],
>   "default": "Unknown"
> }
> {code}
> With the schema provided above, the "Unknown" token should be the value when 
> a value is passed that is not listed in the symbols.
>  
> Requirements:
>  # The default token must exist in the list of symbols when parsing the 
> schema.
>  # When setting the value of the GenericEnum, check if the default is set, 
> and if it is use it if the desired value is not in the symbol map.
>  # Codegen should assign the default symbol to the field by default
>  # The existing behavior should not change if a default is not specified



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to