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

SerializeXmlNode() modifies content if quote is present?

SerializeXmlNode() incorrectly converts the XML content with quotes. It does two modifications: 1) existing quotes are escaped to ' \" ' (slash + quote). 2) the whole resulting string is wrapped in...

Id #25936 | Release: None | Updated: Jan 21 at 5:51 PM by avprokofyev | Created: Jan 21 at 3:00 PM by alaudo

Inconsistent behavior in JsonConvert.DeserializeObject<Hashtable>

Deserializing a Hashtable containing empty string elements in the JSON will produce empty string C# values, until a similar object is serialized, after which deserializing the same JSON will produc...

Id #25919 | Release: None | Updated: Jan 15 at 10:17 PM by tnorrisvnc | Created: Jan 15 at 10:17 PM by tnorrisvnc

DataContract attribute incorrectly inherited

There was a discussion for this here https://json.codeplex.com/discussions/357850 A type deriving from a type decorated with the [DataContract] attribute causes Json.NET to assume opt in serializa...

Id #25889 | Release: None | Updated: Dec 26, 2014 at 10:22 AM by fbrooke | Created: Dec 26, 2014 at 10:22 AM by fbrooke

[JValue] Reference to type 'System.IConvertible' not found

There seems to be some compile-time warning when using JValue in Windows Phone 8.1 application (Windows Store) in Visual Studio 2013. Whenever using the constructor of JValue, I get warning: "Warn...

Id #25853 | Release: None | Updated: Dec 4, 2014 at 1:27 PM by kamenlitchev | Created: Dec 4, 2014 at 1:24 PM by kamenlitchev

JArray.Values<UInt64> doesn't work with values larger than an Int32

foreach(UInt64 value in JArray.Parse("[ 18446744073709551615]").Values<UInt64>()) { Console.WriteLine(value); } Object must implement IConvertible. mscorlib.dll!System.Convert.ChangeType(object va...

Id #25836 | Release: None | Updated: Nov 25, 2014 at 10:52 PM by jpribele | Created: Nov 25, 2014 at 10:52 PM by jpribele