Overriding default servicestack serializer  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Re: Overriding default servicestack serializer

Postby pricerc » Thu Jun 01, 2023 12:48 pm

I think Newtonsoft is a bit more flexible/forgiving than ServiceStack, and that is definitely true of the stock .NET Framework and .NET Core JSON libraries.

Newtonsoft also includes XML <-> JSON conversion functions.
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 504
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 20

Re: Overriding default servicestack serializer

Postby Mike.Sheen » Thu Jun 01, 2023 4:22 pm

pricerc wrote:I think Newtonsoft is a bit more flexible/forgiving than ServiceStack, and that is definitely true of the stock .NET Framework and .NET Core JSON libraries.

Newtonsoft also includes XML <-> JSON conversion functions.


The author of Newtonsoft JSON.NET, James Newton-King, is a Kiwi so you're obligated to say that - being a Kiwi yourself and all :P

Seriously though, I've seen a lot of contributions by James in the .NET repos around JSON serialisation - so he's actively involved in the built-in .NET JSON functionality as well... Maybe all those features of Json.NET will end up in the standard .NET serialisers.

Anyway, the plugin I provided yesterday enables you to use Json.NET instead of ServiceStack for serialisation - deserialisation would be pretty much the same.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Overriding default servicestack serializer

Postby pricerc » Sat Jun 03, 2023 11:14 pm

Mike.Sheen wrote:The author of Newtonsoft JSON.NET, James Newton-King, is a Kiwi


I honestly didn't know that. (or if I did, I'd forgotten...)

But I think he was/is actually in charge the .NET core one (might still be, I'm too lazy to look for it).

But the "formal" libraries also have an expectation of sticking closer to "formal" standards, whereas a "pure" open-source library can be a bit more flexible and work better with dodgy data that you find "in the real world". E.g. comments aren't supposed to exist in JSON, and so some libraries choke on them (including the .NET core one, I think), but Newtonsoft copes with them.
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 504
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 20

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 19 guests