Replies: 5 comments
-
Can't say that I had thought about that, but what our patching API does internally is pretty close to json patch. If you really want to do this, it'd be far, far simpler to push the json patch directly to Postgres where it can use JS to modify the document w/o having to do any loading. You're problem though is that that completely blows any kind of server side validation. |
Beta Was this translation helpful? Give feedback.
-
I need JSON patch support as well. We expose JSON patching as an operation from our API. I need to dig into this more, but it seems like a JSON patch could be translated to the patch operations that you already support. |
Beta Was this translation helpful? Give feedback.
-
@ejsmith Somebody has brought up JsonPatch in the past, but it didn't go anywhere. It would be relatively easy to add to Marten if we can find a JS implementation that doesn't have a big dependency trail. We'd have to watch out for duplicated fields, but we can beat that. Um, feel like doing a PR for that? |
Beta Was this translation helpful? Give feedback.
-
Yeah, I may do that. I have done a little looking and found a couple postgres implementations, but they are all pretty old. |
Beta Was this translation helpful? Give feedback.
-
We could use an javascript implementation like https://www.npmjs.com/package/json-patch |
Beta Was this translation helpful? Give feedback.
-
Are there any plans to integrate Marten's patching support with ASP.NET Core's JSON patch support?
I've tried integrating them myself, but the API provided doesn't really mix well with Marten's patch API. Specifically the idea is that you apply the JsonPatchDocument to an existing instance, but that would require loading the document which is not what Marten's patch support is about.
Ideally I would like Marten to be able to process a JsonPatchDocument directly.
Beta Was this translation helpful? Give feedback.
All reactions