KevinDockx / JsonPatch

JSON Patch (JsonPatchDocument) RFC 6902 implementation for .NET
MIT License
174 stars 28 forks source link

From camelCase (client) to PascalCase (server) #85

Closed dpescatore closed 6 years ago

dpescatore commented 6 years ago

Hello everybody, it's possible to have camelCase JSON on client and PascalCase object on server and to automatically convert from camelCase to PascalCase? I found an example here but Piotr is using .NET Core version not JsonPatch, and I'm not able to use .NET Core.

I'm using Marvin.JsonPatch.Signed 0.9.0 and I was not able to find this information on web or any documentation about it.

I've read the test classes with some example of camelCase etc. but in my software I've got a JSONPatch sent from client and written in camelCase, not a new object on server.

Any help or documentation is appreciated.

KevinDockx commented 6 years ago

Hi @dpescatore, Marvin.JsonPatch is on par as far as features are concerned with the .NET Core version, so you can inject a custom contract resolver as in the example by Piotr.

Marvin.JsonPatch.Signed is an unofficial port of Marvin.JsonPatch. Afaik it's just a signed version of this library, but v0.9.0 is a pretty old version (2015). Not sure if that one already supports the feature you need.

dpescatore commented 6 years ago

Thanks Kevin I've updated to Marvin.JsonPatch 2.1.0 and now I can add custom contract resolver.

KevinDockx commented 6 years ago

Great! :)