Schema generation does not apply MinLength to property marked with RequiredAttribute.

The RequiredAttribute has properties that allow the programmer to control AllowEmptyStrings. AllowEmptyStrings is false by default, and when false it should be treated as if the MinLength attribut...

Id #63439 | Release: None | Updated: May 15 at 7:21 PM by thebothead | Created: May 15 at 7:21 PM by thebothead

Can't deserialize Regular Expression

I don't seem to be able to have a JSON regular expression get deserialized correctly into a Regex object: public class Configuration { public string FieldName { get; set; } public Regex Sea...

Id #63239 | Release: None | Updated: May 5 at 4:02 PM by SetTrend | Created: May 5 at 4:02 PM by SetTrend

Json.net deserialization silent error byte[]

The following json is not correctly deserialized by Newtonsoft JSON.NET into byte[]: { ID:123, Name:'test', RowVersion: { $current: null, $current_uid: null, $parent_uid: 1, $type: "System.Byte[],...

Id #63126 | Release: None | Updated: Apr 30 at 4:48 PM by xaviergxf | Created: Apr 30 at 4:48 PM by xaviergxf

Conditional property serialization

Hello, I implemented custom JsonConverter by using JsonConverter abstract class and JsonConverterAttribute on some properties of object. In WriteJson abstract method, we can't access root object.S...

Id #63114 | Release: None | Updated: Apr 30 at 12:15 PM by berkayerkoy | Created: Apr 30 at 8:47 AM by berkayerkoy

Problem deserializing descendants of ConcurrentDictionary

Tested on 6.0.4, 6.0.8 and 7.0.1 beta. Let's say we have the class CustomConcurrentDictionary: public class CustomConcurrentDictionary: ConcurrentDictionary<string, List<SomeObject>> { } When I s...

Id #28293 | Release: None | Updated: Apr 1 at 6:25 AM by aiskrenov | Created: Apr 1 at 6:25 AM by aiskrenov

Schema generation marks properties as required when not marked with System.ComponentModel.DataAnnotations.RequiredAttribute

Hello, I am trying to generate a schema for validation using only the attributes in System.ComponentModel.DataAnnotations (i.e. required, key, etc.). When I generate my schema for types I have de...

Id #26028 | Release: None | Updated: Mar 12 at 4:21 PM by thebothead | Created: Mar 12 at 4:21 PM by thebothead

Deserialization fails for arrays with TypeNames.

Eg: void Main() { string data = File.ReadAllText(@"SomeFile.txt"); var jsonSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHa...

Id #25989 | Release: None | Updated: Feb 17 at 8:51 AM by prasannavl | Created: Feb 17 at 8:51 AM by prasannavl

JsonConverter and References

I expected that types converted via JsonConverter could benefit from the settings: PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects Problem 1. Unfortunately this wor...

Id #25983 | Release: None | Updated: Feb 13 at 3:19 PM by raffaeler | Created: Feb 13 at 3:19 PM by raffaeler

Serializer to JSON truncates type name

Newtonsoft.JSON 6.0.8 I'm serializing objects with such a code: using (FileStream fs = File.Open(jsonFilePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite)) ...

Id #25976 | Release: None | Updated: Feb 10 at 10:11 AM by Hlodvig | Created: Feb 10 at 10:07 AM by Hlodvig

Serialize method never returns until Task is complete for tasks.

var tx = new TaskCompletionSource<bool>(); JsonConvert.SerializeObject(tx).Dump(); The SerializeObject never returns in this case. And the whole program is stuck until "tx" actually completes. Whi...

Id #25971 | Release: None | Updated: Feb 9 at 11:45 AM by prasannavl | Created: Feb 9 at 11:38 AM by prasannavl