Commit Graph
251 Commits
Author SHA1 Message Date
Sven BoemerandJames Newton-King 9317d71ac5 Annotate for trim/AOT (in)compatibility (#2980)
Co-authored-by: James Newton-King <james@newtonking.com>
2024-10-11 16:33:15 +08:00
James Newton-King d0a328e8a4 Fix MaxDepth not being used with ISerializable deserialization (#2736) 2022-09-13 08:08:02 +08:00
James Newton-King cb9eed9666 Fix deserializing via constructor with ignored base type properties (#2711) 2022-08-04 15:02:55 +08:00
James Newton-King bf2e2a78e8 Add .NET 6 target (#2677) 2022-05-16 16:12:52 +08:00
James Newton-King 2b0f7a2492 Fix deserializing mistmatched JToken types in properties (#2530) 2021-05-15 11:40:11 +12:00
James Newton-King 583eb12015 Fix missing error when deserializing JToken with a contract type mismatch (#2494) 2021-03-11 21:42:55 +13:00
James Newton-King 60be32f46e Use naming strategy when deserializing dictionary enum keys (#2448) 2021-01-01 21:16:44 +13:00
James Newton-King a222c8b69c Update to net50 and fix warnings (#2424) 2020-11-20 16:35:24 +13:00
everfor 9be95e0f6a Do not treat ignored field as missing member when deserializing from overriden json constructor (#2224) 2019-11-30 11:16:00 +13:00
James Newton-King 6b9f467e81 Update compiler package and fix nullable warnings (#2163) 2019-09-15 21:24:24 +12:00
James Newton-King a213bac448 Fix deserialize via ctor with some existing collection types (#2151) 2019-09-08 20:46:20 +12:00
James Newton-King cdf10151d5 Update Newtonsoft.Json project to use nullable reference types (#1950) 2019-07-29 09:13:42 +12:00
James Newton-King b34a3ccca7 Add MissingMemberHandling to JsonObjectAttribute (#2050) 2019-04-21 14:40:36 +12:00
Damir Ainullin 57a3a65464 Remove duplication of memberName calculation (#1995) 2019-03-10 14:18:25 -07:00
James Newton-King d48558b53b Add support for NamingStrategy to StringEnumConverter (#1885) 2018-10-21 18:27:00 +13:00
James Newton-King 0ce23ff924 Refactor to use new C# language features (#1881)
* Use shorter default syntax
* Inline out variable declarations
* Pattern matching
2018-10-15 12:49:25 +13:00
James Newton-King 0e14a9b80d Write trace message for serializing to non-writable properties (#1871) 2018-10-11 15:52:08 +13:00
James Newton-King 5633e17fc1 Fix JTokenReader not using DateTimeZoneHandling 2018-10-08 10:06:19 +13:00
Maksim Edinarkhov 9b98a11db2 fix for JObject.ToObject to respect DateTimeZoneHandling
https://github.com/JamesNK/Newtonsoft.Json/issues/1531
2018-10-08 10:06:19 +13:00
James Newton-King e079301905 Fix ignored values being set in extension data (#1851) 2018-09-22 13:34:13 -07:00
James Newton-King a913a72024 Fix blank extension data values with required properties and ctor (#1850) 2018-09-22 12:34:47 -07:00
James Newton-King ad246c775a Fix deserializing empty string to empty byte array (#1787) 2018-08-06 15:43:22 +12:00
James Newton-King 42ee730f3a Fix losing DateTime.Kind when deserializing ISO date strings (#1727) 2018-05-28 20:54:01 +12:00
James Newton-King 32f882b5d6 Fixed serializing abstract base class ISerializable on .NET Core (#1712) 2018-05-21 11:17:19 +12:00
James Newton-King ce7f283b94 -Fixed bug when deserializing into existing non-IDictionary collection 2018-02-12 19:47:21 +13:00
James Newton-King 39f2db6f2d -Fixed bug when deserializing into existing non-IList collection 2018-02-11 19:38:12 +13:00
James Newton-King c90e6e871a -Changed enum serialization in dictionary keys to use EnumMemberAttribute 2018-01-31 15:14:03 +13:00
Zoltán Tamási 9f74b979aa Fix support for custom list converters when input is not an array or object 2018-01-15 13:08:58 +01:00
gilad61 e5e901c6d0 Update initialDepth for error handling (#1550)
* Fix target depth when skipping over handled errors

Keep reading until the reader reaches the initial depth rather than initial depth + 1

* Fix the initialDepth when handling errors in lists

The initialDepth should be +1 when handling deserialization errors in lists and arrays in order to not skip subsequent items

* Add unit tests for dictionary error handling

Ignoring errors in dictionary object by completely removing the bad items from the dictionary
2017-12-26 08:47:41 +13:00
Yang Wang f386cc2c48 Fixed issue #1545 (#1548) 2017-12-22 12:11:27 +13:00
James Newton-King fcd5975cd9 -Added ItemNullValueHandling to JsonObjectContract 2017-11-08 16:32:42 +13:00
James Newton-King 4a74cf1b1a -Fixed deserializing with constructor and readonly collection property 2017-10-22 13:03:33 +13:00
James Newton-King 12f886ab99 -Test
-Minor refactor
2017-10-19 23:54:19 +13:00
James Newton-King bbbddf0031 -Changed MemberConverter to be obsolete 2017-07-16 19:55:43 +12:00
James Newton-King 7726b51091 -Fixed reading some types from KeyValuePairConverter incorrectly 2017-05-28 00:47:09 +12:00
Tyler Brinkley b6363c70e6 Stops requiring JsonIgnore properties with ItemRequired (#1302)
* Made JsonIgnore properties not required when using ItemRequired.

* Update JsonSerializerInternalReader.cs

* Update JsonSerializerInternalReader.cs

* Update JsonSerializerInternalReader.cs

* Remove end of file newline
2017-05-03 20:37:51 +12:00
James Newton-King f88ae288bc -Fixed handling error when reading metadata property 2017-04-01 16:49:33 +13:00
James Newton-King bed740f76e -Fixed error attempting to deserialize into read-only collections from non-default constructor 2017-03-05 16:52:58 +13:00
Jon Hanna 8956d3ca9c Fix issues that are variants of those #1182 (#1184)
* Catch excessive objects in json being parsed, even if following a comment.

* Include line info on excessive content for deserialisation.
2017-01-19 10:33:30 +13:00
Jon Hanna 9727996b1a Throw for CheckAdditionalContent when extra content is preceded by comments. (#1183)
Fixes #1182
2017-01-16 14:48:52 +13:00
Florian Greinacher b8e60c773b Change ifdefs to be by feature, not by platform (#1146)
* First pass

* Second pass

* Third pass

* Temporarily change build script to build only portable

* Add portable features for release build

* Add feature constants to build script

* Add more feature constants to build script

* Fix build issues

* Fix build issues

* Get rid of constants in build.ps1

* HAVE_NUMERICS -> HAVE_BIG_INTEGER

* Remove HAVE_NULLABLE

* Remove HAVE_NUMERICS from csprojs

* Add missing ifdef

* Add feature defines to pj

* Re-enable netstd builds

* Fix defines in pj

* Trying to get better build outputs

* Trying to get the build error

* Use newer cli

* Address review feedback; make netstd build work

* Introduce HAVE_DB_NULL_TYPE

* Adapt to upstream changes; address remaining review feedback

* Adapt to upstream changes; address remaining review feedback

* Rename some constants for constistency

* Address review feedback

* -Fixed build with signed assembly

* Fix merge erorr

* Address review feedback

* Introduce HAVE_NON_SERIALIZED_ATTRIBUTE

* HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE
2017-01-12 11:07:02 +13:00
James Newton-King ba79136e4e Merge pull request #1151 from JonHanna/singleton_empty_array
Use singleton for zero-element arrays.
2017-01-09 15:11:14 +13:00
Jon Hanna ff3bfaf51b Use singleton for zero-element arrays.
Create an easily-inlinable method that accesses the array used
by Enumerable.Empty (and hence not just shared within this project
but likely with the client assembly or other libraries it uses)
and use it anywhere a zero-element array is used, reducing allocations.
2017-01-09 01:50:03 +00:00
Jon Hanna f4c17aedb2 Coalesce nulls rather than null test where applicable. (#1150) 2017-01-08 15:36:31 +13:00
James Newton-King 211b3b0db2 Merge pull request #1132 from JonHanna/favour_as_over_is
Replace is-and-cast with as-and-nullcheck
2017-01-05 17:00:42 +13:00
Jon Hanna a95665b481 Replace is-and-cast with as-and-nullcheck
Gives slightly better performance, so applying across the board
adds up.
2017-01-05 01:52:04 +00:00
James Newton-King 008a3c7655 Merge pull request #1126 from JonHanna/remove_list_array
Remove some unnecessary list and array allocations.
2017-01-05 11:32:37 +13:00
Jon Hanna d408066f64 Remove some unnecessary list and array allocations. 2017-01-04 22:22:26 +00:00
James Newton-King 306c3a812b Merge pull request #1125 from JonHanna/null_propogate
Use null-propogation where applicable and useful.
2017-01-05 11:15:49 +13:00
stakx 8639ac94ae Typos
Running a spell checker on the whole solution revealed a couple more
typos. This fixes all of those (although internal // line comments are
mostly left alone).

Additionally, convert a very few string.Format occurrences to the pre-
dominant .FormatWith pattern and fix some incorrect message strings.
2017-01-04 03:01:26 +01:00