[
https://issues.apache.org/jira/browse/AVRO-4346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ismaël Mejía updated AVRO-4346:
-------------------------------
Parent: AVRO-4345
Issue Type: Sub-task (was: Bug)
> [csharp] Validate enum symbols and protocol names against the Avro name
> grammar at parse time
> ---------------------------------------------------------------------------------------------
>
> Key: AVRO-4346
> URL: https://issues.apache.org/jira/browse/AVRO-4346
> Project: Apache Avro
> Issue Type: Sub-task
> Components: csharp
> Reporter: Ismaël Mejía
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.13.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> AVRO-4314 added Avro name-grammar validation for record/fixed/enum names,
> field
> names and aliases, and message names. Two paths remain unvalidated:
> * *Enum symbols read from JSON*: {{EnumSchema.NewInstance}} only checks for
> duplicate symbols and does not call {{ValidateSymbolName}} (that runs only
> on
> the programmatic {{Create()}} factory). Symbols are then emitted directly as
> enum member identifiers by the generator (around {{CodeGen.cs}}:499), so an
> out-of-spec symbol (spaces, punctuation, leading digit, ...) produces
> malformed
> generated C#.
> * *Protocol names*: {{Protocol.Parse}} and the {{Protocol}} constructor never
> call {{ValidateName}}; the protocol name is emitted as generated class names
> ({{CodeGen.cs}}:522 and :603), so an out-of-spec protocol name produces
> malformed source.
> Validate enum symbols (on the JSON parse path) and protocol names against the
> Avro name grammar at parse time, matching the Java SDK, and add tests covering
> rejection of out-of-spec values.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)