[
https://issues.apache.org/jira/browse/AVRO-4314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ryan Skraba resolved AVRO-4314.
-------------------------------
Fix Version/s: 1.13.0
1.12.2
Resolution: Fixed
> [csharp] Validate names against the Avro name grammar at parse time
> -------------------------------------------------------------------
>
> Key: AVRO-4314
> URL: https://issues.apache.org/jira/browse/AVRO-4314
> Project: Apache Avro
> Issue Type: Bug
> Components: csharp
> Reporter: Ismaël Mejía
> Assignee: Ismaël Mejía
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.13.0, 1.12.2
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The Avro specification requires record/enum/fixed names, field names, enum
> symbols, and protocol message names to match `[A-Za-z_][A-Za-z0-9_]*` (with
> dotted namespaces). The Java SDK enforces this during parsing, but the C# SDK
> does not validate all of these.
> In the C# SDK only enum symbols are validated (EnumSchema); record/fixed/enum
> names, namespaces, field names, and protocol message names are accepted
> verbatim (SchemaName, Field, Message). Because the C# code generator splices
> some of these values directly into generated source (for example protocol
> message names into a `case "..."` label and field names into Get/Put switch
> bodies via CodeSnippetExpression), an out-of-spec name produces malformed or
> unexpected generated C# code.
> Proposal: validate names, field names, and message names against the Avro
> name grammar during schema/protocol parsing in the C# SDK, matching the Java
> SDK behavior, and add tests covering rejection of out-of-spec values.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)