Havunen / SystemTextJsonPatch

SystemTextJsonPatch is a JSON Patch (JsonPatchDocument) RFC 6902 implementation for .NET using System.Text.Json
MIT License
102 stars 12 forks source link

Support JsonSerializerOptions options in Copy operation #13

Closed vahoang closed 2 years ago

vahoang commented 2 years ago

Description

Currently only the Copy operation at here does not use the provided JsonSerializerOptions.

To Reproduce

Tasks

vahoang commented 2 years ago

@Havunen Can help me double check if the issue is valid and if I can help you to fix it, many thanks!!

Havunen commented 2 years ago

Yeah, I think it should ideally use the provided options in those Serialize methods, but there was some issue where the logic got into infinite loop because it was calling itself. That needs to be tested.

vahoang commented 2 years ago

@Havunen Do you recall how did you end up with such infinite loop cause I did some tests and cannot reproduce it.

Havunen commented 2 years ago

Ah, it seems TryConvertTo was already passing the json serializer options there, I believe I fixed it at some point then. Yeah this sounds like a bug

Havunen commented 2 years ago

Fixed in v0.0.9

vahoang commented 2 years ago

Thanks for the swift replies and fix !!