Different behavior of PreserveReferencesHandling.Arrays option with privius versions

serializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.Arrays; List<SomeClass>, where SomeClass has properties SomeProperty and SomeList property which is List<SomeSubClass1> w...

Id #63786 | Release: None | Updated: Jul 30 at 9:16 AM by MykhayloA | Created: Jul 30 at 9:16 AM by MykhayloA

Private method reflection at deserialization

Hi We have the following problem with at deserialization time. We have task framework (plugin system) and a client server application. We need to send the tasks to the client in order to edit the...

Id #63733 | Release: None | Updated: Jul 20 at 8:39 AM by oscarito | Created: Jul 20 at 8:39 AM by oscarito

Windows 10: Error using Newtonsoft.JsonSeverity Code Description Project File Line

Hi I can use Newtonsoft.Json on Windows 10 in debug mode, but when using Release, it does not compile with the error: Assembly 'Newtonsoft.Json' invokes 'Attribute.GetCustomAttributes(Assembly)' ...

Id #63569 | Release: None | Updated: Jul 9 at 8:15 AM by AThenn | Created: Jun 23 at 1:50 PM by Dumdidum

GeoJson

Can I define a class list for GeoJson ? http://geojson.org/geojson-spec.html#feature-objects Is Newtonsoft support it?

Id #63492 | Release: None | Updated: May 30 at 12:14 AM by bfbd | Created: May 30 at 12:14 AM by bfbd

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

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: Jul 6 at 11:45 AM 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

Deserialization of invalid date error does not include position information when using IsoDateTimeConverter

If a date is read with an invalid format, the error message does not include any information about the position of the error. Using this model: class TestModel { [Newtonsoft.Json.JsonConverter...

Id #25829 | Release: None | Updated: Nov 17, 2014 at 10:22 AM by colinbreame | Created: Nov 17, 2014 at 10:22 AM by colinbreame

JsonConvert.DeserializeXNode not available for WP8.1 anymore?

I updated Json.Net from 6.0.3 to 6.0.6 today and found that JsonConvert.DeserializeXNode is not available for WP8.1 anymore, but is still working in my WinRT background task and Windows app. Do I ...

Id #25828 | Release: None | Updated: Nov 16, 2014 at 2:18 PM by sibbl | Created: Nov 16, 2014 at 2:18 PM by sibbl

Newtonsoft.Json.PreserveReferencesHandling.None not being applied

In my Web API config I have the following set: jsonFormatter.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.None; But I still get $id/$ref output when s...

Id #25741 | Release: None | Updated: Sep 22, 2014 at 2:59 PM by ledzeppln | Created: Sep 22, 2014 at 2:59 PM by ledzeppln

Allow setting of $id property for PreserveReferencesHandling

We use guids for our EF ids, it would be great to be able to specify that a particular property could be used as the $id property for purposes of PreserveReferencesHandling

Id #25698 | Release: None | Updated: Oct 18, 2014 at 10:35 PM by JamesNK | Created: Aug 28, 2014 at 2:34 AM by eggers

Cannot install in Windows Phone 7 project

Cannot install in Windows Phone 7 project. While installing with PM> Install-Package Newtonsoft.Json Visual Studio returns an error: Install failed. Rolling back... Install-Package : Could not ...

Id #25679 | Release: None | Updated: Aug 20, 2014 at 7:00 AM by giacoder | Created: Aug 20, 2014 at 7:00 AM by giacoder

Deserialization of large JSON returns tokens with missing/truncated items

I have been using JSON.NET for a long time but now I have run accross an unexpected issue. I am trying to deserialize a really long json string which is an array of objects; I am parsing as JToke...

Id #25678 | Release: None | Updated: Aug 19, 2014 at 6:03 PM by allanx2000 | Created: Aug 19, 2014 at 6:03 PM by allanx2000

References context lost when using a custom JsonConverter.

I've created a JsonConverter for one of my objects to write and parse an added property. I've followed the example provided with the documentation for CustomJsonConverter but there seems to either...

Id #25586 | Release: None | Updated: Jul 2, 2014 at 7:23 PM by GandalfThePlaid | Created: Jul 2, 2014 at 7:23 PM by GandalfThePlaid

Add support for conditional serialization with dynamically added ShouldSerialize-prefixed predicate delegates

Json.NET Documentation specifies 'the ability to conditionally serialize properties by placing a ShouldSerialize method on a class'. However, testing with a dynamically added System.Func<bool> to S...

Id #25579 | Release: None | Updated: Jun 30, 2014 at 1:34 PM by Gorban | Created: Jun 30, 2014 at 1:34 PM by Gorban

Use System.IO.Stream async IO functions to offer async serialization and deserialization

Hello - In .NET 4.5, async I/O methods were added to System.IO.Stream. It would be awesome if JsonTextReader and JsonSerializer added support for these methods to allow for DeserializeAsync and Se...

Id #25576 | Release: None | Updated: Nov 20, 2014 at 8:52 PM by akolomentsev | Created: Jun 27, 2014 at 7:50 PM by AndrewGaspar

WCF Add service reference and Json.net

When adding reference to a service in a web project that has the json.net package, the generated client proxy is using XmlSerializer instead of DataContractSerializer. If the json.net package is re...

Id #25564 | Release: None | Updated: Aug 15, 2014 at 6:32 PM by jlspublic | Created: Jun 18, 2014 at 2:51 PM by vjgn

Missing System.Xml.Linq Error when serializing an object

Hi, I am trying to create a portable class library that I can use to call a service. I want to use JSon.Net to serialize the objects before sending to the rest service and I want to deserialize wh...

Id #25550 | Release: None | Updated: Jun 13, 2014 at 3:24 PM by WichitaJS | Created: Jun 13, 2014 at 3:22 PM by WichitaJS

Could not load file or assembly 'Newtonsoft.Json ....'

i just used web api self-host. but there thrown a error when i new HttpSelfHostConfiguration: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublickKeyToken=30...

Id #25548 | Release: None | Updated: Jun 12, 2014 at 8:10 AM by StevenWang | Created: Jun 12, 2014 at 3:19 AM by StevenWang

Unity 4.5 now requires iOS Pro when using JsonDotNet

Hiya, We have recently upgraded our Unity installations within our studio to 4.5 and begun noticing build errors with team members attempting to create iOS builds -- stemming from a dependency in ...

Id #25530 | Release: None | Updated: Jun 4, 2014 at 8:31 PM by mccc | Created: Jun 4, 2014 at 8:31 PM by mccc

CustomCreationConverter not use if type name embedded in JSON string

When I deserialize json string which has type embedded in header, my CustomCreationConverter is not used. It is searching for Converters for object instead. It works only if type is explicit in c...

Id #25526 | Release: None | Updated: Jun 4, 2014 at 7:42 AM by aruzicka | Created: Jun 4, 2014 at 7:42 AM by aruzicka

Object property name has extra space when serialized

I am using Json.Net for .net 2.0 v4.0.2.13623 in a VB.Net project to serialize a complex set of objects to Json. This has worked successfully for months on the same set of objects. Now I am seeing ...

Id #25469 | Release: None | Updated: May 29, 2014 at 3:15 AM by Sevensnake | Created: May 13, 2014 at 6:29 PM by crossle86

Use different file name for portable and non-portable Newtonsoft.Json.dll

If you have a solution that uses both portable and non-portable ( =.NET 4.5 core) projects, and build the solution to bin-folder, then the references are copied to the same folder. Now, if you re...

Id #25447 | Release: None | Updated: Jun 16, 2014 at 10:56 AM by DangerT | Created: May 2, 2014 at 7:48 AM by Thorium

conflicting parameter name in a constructor and in a class property

Problem: a class has a property of type of some abstract class marked as JsonObject. At the same time, this class has a constructor with one of the parameters with the same name as property but d...

Id #25389 | Release: None | Updated: Apr 14, 2014 at 1:08 AM by AlexeyKostylev | Created: Apr 14, 2014 at 12:50 AM by AlexeyKostylev

Add support to DataTableConverter for FloatParseHandling

Could you please add support for JsonSerializerSettings.FloatParseHandling setting to DataTableConverter. Thanks.

Id #25259 | Release: None | Updated: Mar 12, 2014 at 12:16 PM by Mike_R | Created: Mar 12, 2014 at 12:16 PM by Mike_R

DateTimeZoneHandling.Utc discards serialized timezone

Hi, JsonSerializer discards timezone information from serialized string, thus deserializes it incorrectly. Assuming that JsonSerializer is parametrized with DateTimeZoneHandling.Utc, it should ser...

Id #25075 | Release: None | Updated: Feb 20 at 6:52 AM by ThomasZ_rts | Created: Jan 14, 2014 at 1:37 PM by savamura

System.Reflection.BindingFlags Build Warnings on Windows Phone

Hey there, Really great work on the library. I use it basically everywhere! However, I encountered a build warning when I build my Windows Phone app, something like the following: c:\a\src\extern...

Id #25009 | Release: None | Updated: Jul 9 at 9:44 PM by RandomEngy | Created: Dec 18, 2013 at 6:16 AM by ChrisKXu

Issue with regular pattern matching during schema validation

Hi, I just ran into a problem when trying to validate a schema using a regular expression. I have this in my schema: 'time': { 'description': 'The time the event occurred in ISO 8601 ...

Id #24730 | Release: None | Updated: Jul 16, 2014 at 12:32 PM by dcastro | Created: Sep 25, 2013 at 5:11 PM by Breggles

Allow custom TypePropertyName et al

I'm using angular.js which strips out any properties prefixed with '$' when converting an object to json. This causes json.net to be unable to determine the actual type of the object when deserial...

Id #24677 | Release: None | Updated: May 5, 2014 at 12:46 PM by StevenLiekens | Created: Sep 4, 2013 at 3:42 PM by lindexcorp

Allow custom JsonConverters to serialize null

Related to discussion here: https://json.codeplex.com/discussions/280134 JSON.NET will not currently allow custom JsonConverter implementations to serialize null. This is a problem for me (and se...

Id #24577 | Release: None | Updated: Aug 20, 2014 at 9:01 AM by Krimson | Created: Aug 2, 2013 at 3:43 PM by JamesGreene

NullReferenceException using 'required' in JsonSchema

JsonSchema.Parse() gets a NullReferenceException if the schema contains the 'required' property. EDIT: I now see why this wasn't working. http://json-schema.org/examples.html shows 'required' as t...

Id #24038 | Release: None | Updated: Sep 23, 2013 at 4:58 PM by Breggles | Created: Mar 5, 2013 at 1:50 PM by RickMohr

Custom Error Message

Can we define our own error message for JSON validate method?   For example, this error message "String '1490AA00' does not match regex pattern '^(\d{5})[A-Z]{2}(\d{2})$'." does not make much sense...

Id #22537 | Release: None | Updated: Feb 22, 2013 at 1:48 AM by JsonSpc | Created: Apr 23, 2012 at 3:00 AM by JsonSpc

JsonTypeReflector.DynamicCodeGeneration Security Issue

Hello,   I think there is an issue with the way JsonTypeReflector.DynamicCodeGeneration is set. It is a lazy static getter that is never updated. The value of JsonTypeReflector.DynamicCodeGeneratio...

Id #21575 | Release: None | Updated: Feb 22, 2013 at 1:48 AM by B4ptiste | Created: Sep 27, 2011 at 4:31 PM by B4ptiste

SerializeObject<T> - use the typeof(T)

Hi,   More info: http://json.codeplex.com/discussions/245862   Either: a SerializeObject<T> where T is used as type for reflecting the properties and not the actual type of the item being passed. ...

Id #20017 | Release: None | Updated: Feb 22, 2013 at 1:48 AM by DanielSchaffer | Created: Feb 15, 2011 at 6:58 AM by sedanwer

  • 1-46 of 46 Work Items
    • Previous
    • 1
    • Next