You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Shannon Carey (Jira)" <ji...@apache.org> on 2021/03/04 17:56:00 UTC

[jira] [Commented] (AVRO-2659) [JAVA] Some full names are not correctly validated.

    [ https://issues.apache.org/jira/browse/AVRO-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17295478#comment-17295478 ] 

Shannon Carey commented on AVRO-2659:
-------------------------------------

Yeah, specifically, the spec states:
{quote}The name portion of a fullname, record field names, and enum symbols must:
 * start with [A-Za-z_]
 * subsequently contain only [A-Za-z0-9_]{quote}
but Avro's {{org.apache.avro.Schema.validateName()}} is permitting much more than that.

> [JAVA] Some full names are not correctly validated.
> ---------------------------------------------------
>
>                 Key: AVRO-2659
>                 URL: https://issues.apache.org/jira/browse/AVRO-2659
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Ryan Skraba
>            Assignee: Ryan Skraba
>            Priority: Minor
>
> The Java implementation will parse a schema with an obviously bad name:
> {code:json}
> { "type":"record",
>   "name":"org.9apache.äv rö.🚎.$!#!@%$.Sïmplé۵",
>   "fields": [
>     {"name":"id", "type": "int"}
>   ]
> }
> {code}
> For Java:
>  * no rules are applied to the namespace part of a full name, and
>  * the {{isLetterOrDigit}} methods in Character accept accented or multibyte letters and digits
>  * _(ambiguous)_ when a full name is specified, the namespace attribute is entirely ignored. Should it be an error if it contains a bad namespace?
> We should be applying the rules to all of the dot-delimited parts of a full name and namespace (unless ignored).  Rules should be applied to named types, field names, and aliases consistently.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)