JsonRazor 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package JsonRazor --version 1.3.0                
NuGet\Install-Package JsonRazor -Version 1.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JsonRazor" Version="1.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JsonRazor --version 1.3.0                
#r "nuget: JsonRazor, 1.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JsonRazor as a Cake Addin
#addin nuget:?package=JsonRazor&version=1.3.0

// Install JsonRazor as a Cake Tool
#tool nuget:?package=JsonRazor&version=1.3.0                

1.3.0:

Changes to existing code:

I don't like to break compatibility but it somehow had to be done. So:

  • IToken.LoadTokens() behaviour was changed, since it was terribly stupid. It would stream tokens only once, when loaded. Now it streams them no matter in what loaded-state IToken is. Also all arguments were removed.
  • IToken.QueryTokens() still maintains only-one-enumeration behaviour (at least now that is documented), but optimizeLoad argument was removed. This is sole purpose of this method. Now, since LoadTokens works, it can replace it in other scenarios.
  • Assembly versioning abandons this retarded, 4-number notation. Now, 3-number notation may prevail.

I was also gonna add default values to Serializer's methods ModelMembers args, but value Both is poorly choosen; changing it to Property would be inconsistent in the API, so i ended up givin' up. I will refrain from changing defaults, as it way have lots of unintended side effects.

Fixes:

  • JsonArray with only simple values could be in 'dirty' state even after being parsed.
  • JsonObject when parsed would throw exception on property names of 1 char.
  • JsonStream.StreamConverted() would throw on List<T>.
  • IToken.QueryTokens() would incorrectly manage loading when optimize load was enabled. Also QueryResult.Fail was handled incorrectly.
  • IToken.LoadTokens (and Count) would break state of object/array.
  • Quote-writing policy would be inconsistent. Now null, true and false serialize without quotes. Everything else with them.
  • There was something else but I totally forgot what it was, nvm it's fixed now.

New features:

  • Serialization and deserialization support for Nullable<T> - when in null state, it serializes to null, otherwise to content T of nullable.
  • Support for nulls in arrays! Previously when array was serialized with nulls, they would have been removed in deserialization. Now this behaviour stays only with standard JsonToken parsing, but when deserializing such an array, nulls will stay at their original index. This is sadly impossible for base parsing, since there's no type info.
  • JsonToken now exposes three new constants. This is really important to mention (really).

Performance:

  • Sadly, no noticeable change, probably. Some old code was dumped, so assembly size went down around 1KB. IToken.Count was optimised a bit.

Docs:

Some of documentation headers were edited (in placed when they obviously stated some gibberish) and new were added where appriopriate, altho there're still blanks.

New year, new better version, etc etc. I'm really sorry that it took that long for these changes, i've just been busy and doing other important stuff. Now things will change a bit (I hope). Next version release will most likely bring better IToken query method, maybe with overloads for de/serializing that take Type, instead of being generic.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net is compatible.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.2 1,334 2/6/2022
2.0.1-rc 854 12/11/2021
2.0.0-rc 1,011 7/4/2021
1.5.1 2,241 9/27/2019
1.5.0 1,377 7/27/2019
1.4.0 1,408 6/5/2019
1.3.1 1,594 1/25/2019
1.3.0 1,530 1/1/2019
1.2.2.8 1,916 7/6/2018
1.2.2.7 1,874 6/25/2018
1.2.2.6 1,735 6/9/2018
1.2.2.5 2,037 3/31/2018
1.2.2.2 1,926 10/7/2017
1.2.2.1 1,816 10/4/2017
1.2.2 1,851 10/1/2017
1.2.0.1 1,797 8/15/2017
1.1.0.10 1,933 6/25/2017

New features include de/serialization support for nullable types and nulls in arrays. There are some changes to existing API.
Also important bug fixes. Go check changelog for all details.