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

Edmond Wong commented on AVRO-3856:
-----------------------------------

First time I really tried to contribute to open source community by providing 
fixes but was getting nowhere with Newtonsoft, or Apache Avro. For the closing, 
our company architects approved the source team to use string for the value for 
XML format. To all who cares I wish you with good luck using deeply nested Avro 
schema.

> Cannot parse Avro schemas for a record with depth less than the default 
> maximum of 64 in C#
> -------------------------------------------------------------------------------------------
>
>                 Key: AVRO-3856
>                 URL: https://issues.apache.org/jira/browse/AVRO-3856
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp
>    Affects Versions: 1.11.2
>            Reporter: Emanuele Sabellico
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> When parsing the Avro Schema with Newtonsoft.Json max depth is limited to 64, 
> the default. It cannot be customized because it's using JObject.Parse that 
> doesn't allow to customize it.
> Using JsonConvert could allow to change default MaxDepth
> {code:c#}
>                 JsonConvert.DefaultSettings = () =>
>                 {
>                     return new JsonSerializerSettings
>                     {
>                         MaxDepth = 100
>                     };
>                 };
>                 var schema = File.ReadAllText("schema.avsc");
>                 var json = JsonConvert.DeserializeObject<JObject>(schema);
> {code}
> [https://github.com/apache/avro/blob/41b3c08ca5da192786c2b08546e691b3126e1856/lang/csharp/src/apache/main/Schema/Schema.cs#L250]
> An alternative solution is to configure Json max depth so it corresponds to 
> an Avro schema for a 64 levels depth record.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to