Skip to content

Honor [JsonProperty] attributes and ContractResolver #44

@thomaslevesque

Description

@thomaslevesque

I'm looking into using this library for making JSON Patch requests, however I often use the [JsonProperty] attribute (and custom contract resolvers), and this library doesn't take them into account.

It probably works fine if both the client and server use the same library, but it's not the case for me; the back-end is written in Java, and property names are case-sensitive, so if I send /parentid instead of /parentId, it won't work...

I haven't looked at the code yet, but I suspect the change would be fairly simple. A simple solution would be to add a JsonPatchDocument<T> constructor overload that takes a contract resolver, and use that to resolve the property name, instead of just lowercasing the C# property name.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions