You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Brian Lachniet (Jira)" <ji...@apache.org> on 2020/11/15 00:48:00 UTC
[jira] [Resolved] (AVRO-2750) Support for enum defaults in c#
[ https://issues.apache.org/jira/browse/AVRO-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Lachniet resolved AVRO-2750.
----------------------------------
Fix Version/s: 1.10.1
Release Note: Added support for enum defaults in the C# bindings.
Resolution: Fixed
Merged to master in [e42b44e|https://github.com/apache/avro/commit/e42b44e0bfeaaf1fcfd28bb7396b7f663ec1aa50] and cherry-picked to branch-1.10 in [aeef3bf|https://github.com/apache/avro/commit/aeef3bf628a090abe5952cf2e858cec3d48004c4].
> 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
> Fix For: 1.10.1
>
>
> 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)