Ismaël Mejía created AVRO-4345:
----------------------------------
Summary: Consistently validate schema-derived names and escape
values in the code generators
Key: AVRO-4345
URL: https://issues.apache.org/jira/browse/AVRO-4345
Project: Apache Avro
Issue Type: Improvement
Components: csharp, c++, java
Reporter: Ismaël Mejía
Fix For: 1.13.0
h2. Summary
The code generators (Java {{SpecificCompiler}}, C# {{CodeGen}}, C++
{{avrogencpp}})
turn schema-derived values -- record/field/enum names, enum symbols, namespaces,
documentation strings, and other string properties -- into generated source
code.
To produce well-formed output consistently across SDKs, these values should be
validated against the Avro name grammar ({{[A-Za-z_][A-Za-z0-9_]*}}, with dotted
namespaces) at parse time, and safely escaped when emitted, so that unusual or
out-of-spec schema content yields a clear parse error or well-formed generated
code rather than malformed source.
The Java SDK already validates names at parse time and escapes documentation;
this umbrella tracks aligning the other SDKs and closing the remaining
per-language
gaps.
h2. Related per-SDK work
* Java: AVRO-4053, AVRO-4311, AVRO-4313
* C#: AVRO-4314 (names) + follow-up for enum symbols and protocol names on the
JSON parse path
* C++: AVRO-4312 (field names / enum symbols) + name-grammar first-character
check
Note: the Rust implementation ({{apache-avro-derive}}) now lives in the separate
avro-rs GitHub repository and should be reviewed there.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)