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

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

Commit a86dde293841a5f7856c11c799ca6561e6745419 in avro's branch 
refs/heads/dependabot/npm_and_yarn/lang/js/jshint-2.13.1 from tom-j-irvine
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=a86dde2 ]

AVRO-2633: C# include schema doc (#1070)

* AVRO-2633 - csharp include schema doc

* AVRO-2633 - update tests for doc attribute

updated TestRecordDoc to test both the parsing and reserializtion - thanks 
@BarryDahlberg
updated the doc serialization logic to preserve empty strings (and only 
eliminate nulls)

Co-authored-by: Tom Irvine <t...@simplement.us>
Co-authored-by: RyanSkraba <r...@skraba.com>

> C# - AvroGen tool - Document for record type is not included in the Schema 
> field
> --------------------------------------------------------------------------------
>
>                 Key: AVRO-2633
>                 URL: https://issues.apache.org/jira/browse/AVRO-2633
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp
>    Affects Versions: 1.9.1
>            Reporter: Minh Nguyen
>            Assignee: Tom Irvine
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.11.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Steps to reproduce:
>  1) MyRecord.asvc file : 
>   
> {code:java}
> {
> "type" : "record",
> "doc" : "Doc for record"
> "name" : "MyRecord",
> "namespace" : "My.Namespace",
> "fields" :
>               [
>                       { "name" : "Field1", "type" : "int" }
>               ]
> }
> {code}
> 2) Run command to generate C# class from the Avro spec file:
>  avrogen -s MyRecord.asvc ./
> -> Current behavior: the Schema field in C# class is missing the "doc" data, 
> I got serialization error when tried to use this class because the subject in 
> Schema Registry contains the "doc" field (I register the avro spec file to 
> the schema registry seperately)
> {code:java}
>       public partial class MyRecord : ISpecificRecord
>       {
>               public static Schema _SCHEMA = 
> Schema.Parse("{\"type\":\"record\",\"name\":\"MyRecord\",\"namespace\":\"My.Namespace\",\"fields\":[{\"name\":\""
>  + "Field1\",\"type\":\"int\"}]}");
> {code}
> -> Expected behavior: we should have the "doc" field for type "record", so it 
> will be consistent with the spec file
> {code:java}
>       public partial class MyRecord : ISpecificRecord
>       {
>               public static Schema _SCHEMA = 
> Schema.Parse("{\"type\":\"record\", \"doc\":\"Doc for record\",  
> \"name\":\"MyRecord\", \"namespace\":\"My.Namespace\", 
> \"fields\":[{\"name\":\"" + "Field1\",\"type\":\"int\"}]}");
> {code}
> As a work around, right now I have to remove the "doc" for the type "record" 
> but I think we should have it there and not causing a problem.



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

Reply via email to