SystemTextJsonPatch
SystemTextJsonPatch copied to clipboard
JsonPatchDocument converter doesn't respect other converters added to JsonSerializerOptions
Hi! We have string converter which trims string values and replaces empty strings with null
. When JsonPatchDocumentConverter
reads string values (specifically from value
fields), it just uses val = reader.GetString()
, so it ignores any string converters added to default JsonSerializerOptions
. Is it possible to change value reading logic to just val = JsonSerializer.Deserialize<object>(ref reader);
instead of this and this switch statements, to allow other converters to process values? Thanks!
So, what do you think? :)
We need to measure how much it affects the performance and make sure it does not create infinite loops, otherwise sounds good to me
One possibility is to bring this feature in as a new option