[
https://issues.apache.org/jira/browse/AVRO-4312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ismaël Mejía updated AVRO-4312:
-------------------------------
Description:
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, type names and namespaces are validated (Name::check), but
field names and enum symbols are not; they are emitted as C++ identifiers after
only reserved-word decoration, so out-of-spec values produce malformed
identifiers.
Proposal: validate field names and enum symbols against the Avro name grammar
during schema parsing in the C++ SDK, matching the Java SDK behavior, and add
tests covering rejection of out-of-spec values.
was:
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, type names and namespaces are validated (Name::check), but
field names and enum symbols are not; they are emitted as C++ identifiers after
only reserved-word decoration, so out-of-spec values produce malformed
identifiers.
Proposal: validate field names and enum symbols against the Avro name grammar
during schema parsing in the C++ SDK, matching the Java SDK behavior, and add
tests covering rejection of out-of-spec values.
Note: this ticket was split from a combined [c++][csharp] issue; the C# part is
now tracked separately.
> [c++] Validate field names and enum symbols against the Avro name grammar at
> parse time
> ---------------------------------------------------------------------------------------
>
> Key: AVRO-4312
> URL: https://issues.apache.org/jira/browse/AVRO-4312
> Project: Apache Avro
> Issue Type: Bug
> Components: c++
> Reporter: Ismaël Mejía
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1.5h
> 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, type names and namespaces are validated (Name::check), but
> field names and enum symbols are not; they are emitted as C++ identifiers
> after only reserved-word decoration, so out-of-spec values produce malformed
> identifiers.
> Proposal: validate field names and enum symbols against the Avro name grammar
> during schema 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)