Client libraries for .NET

Hi all,

I’m currently comparing the client libraries for .NET listed at http://jsonapi.org/implementations/#client-libraries-net - and was confused to see that Json.NET is missing from the list, other than in its extended form of JsonApiSerializer.

Is there a reason that it’s missing from the list, simply that nobody has requested that it is added maybe? Or is there some glaring pitfall that I haven’t spotted?

As you may be able to tell, I’m fairly fresh to jsonapi/.NET coming in from an OpenEdge background and currently taking my first foray in to these sorts of libraries.

Thanks in advance for any information you may be able to give me :slight_smile:

I think you would just submit a PR to add the library to the support list on GitHub if you encounter one which is missing.

Hi Michael,

Thanks for your reply - I guess my main question really was, is there a major reason not to use it? I’m just a little suspicious that such a well used library isn’t already in the list.

Thanks,

Martin

It’s a passively maintained list, it’s quite easy to believe many others assumed the same if they even knew about the list in the first place.

Hi,

It’s not as straight forward as just using Json.Net, you would need to do one of two things;

a) Modify your objects so you are returning something in the shape of the JsonApi format, ie,
var document = new Document { type = “something”, id = “123”, attributes = { … } }

b) Write a custom Json.Net serializer that converts your object to the format of the JsonApi specification. This would be quite simple if you are just interested in adhering to a small portion of the JsonApi specification, but it would become harder when you want to start working with relationships and included/sideloaded entities.

As a disclaimer, I am the maintainer of the Hypermedia.JsonApi.Client library;

Thanks,
Cain.