You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/07/02 12:07:00 UTC

[jira] [Commented] (AVRO-2757) ReflectData still generates namespaces with dollar signs

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

ASF subversion and git services commented on AVRO-2757:
-------------------------------------------------------

Commit 2c7b9af7d5ba35afe9cf84eae3b273a6df0612b1 in avro's branch refs/heads/master from RyanSkraba
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=2c7b9af ]

AVRO-2757: Avoid dollar signs when reflecting Java. (#914)



> ReflectData still generates namespaces with dollar signs
> --------------------------------------------------------
>
>                 Key: AVRO-2757
>                 URL: https://issues.apache.org/jira/browse/AVRO-2757
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Ryan Skraba
>            Assignee: Ryan Skraba
>            Priority: Major
>
> ReflectData should always generate valid Avro schemas for Java classes.  Currently, the name and namespace are taken from the Java class name, which can contain dollar signs.  AVRO-2143 fixed this for the most common cases for nested classes.
> It's still possible to generate namespaces with a dollar sign for classes that are nested more than one level.  This can be observed in this unit test:
> [https://github.com/apache/avro/blob/70260919426f89825ca148f5ee815f3b2cf4764d/lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java#L842]
> which generates
> {code:java}
> {
>   "type" : "record",
>   "name" : "AnotherSampleRecord",
>   "namespace" : "org.apache.avro.reflect.TestReflect$SampleRecord",
>   "fields" : [ {
>     "name" : "a",
>     "type" : [ "null", "int" ],
>     "default" : null
>   }, {
>     "name" : "s",
>     "type" : [ "null", {
>       "type" : "record",
>       "name" : "SampleRecord",
>       "namespace" : "org.apache.avro.reflect.TestReflect",
>       "fields" : [ {
>         "name" : "x",
>         "type" : "int"
>       }, {
>         "name" : "y",
>         "type" : "int"
>       } ]
>     } ],
>     "default" : null
>   } ]
> }
> {code}
>  



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