You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Allow adjustment of the JsonSerializerSettings in JObjectHelper that is used by JsonSnapshotStore, so that snapshots can be made more readable e.g. when using custom JsonConverters they are taken into account.
e.g. an example of the current behaviour
"myList": [
{
"Name": "My SmartEnum",
"Value": "My Value that should be used instead"
}
],
after allowing to add converters for instance
"myList": [
"My Value that should be used instead"
],
Describe the solution you'd like
Not yet full thought through, but maybe
Allow defining a convention based class e.g. **CustomSnapshotSerialzation** that could expose either the complete JsonSerializerSettings or hooks to be called by the default implementation when adding converters.
What would be great is to at least be able to add the following
Thanks for making the issue.
I've definitely thought about doing this in the past so that users could use their own serialiser settings.
I've shied away from it in the past as I didn't want to expose the internal working of Snapper. Specifically the usage of Newtonsoft.Json. I will most likely be switching to System.Text.Json in the future once it is more feature rich and ideally the change should not be noticeable by consumers.
As an alternative have you thought about converting your object into a jobject using your own serialiser before calling Snapper?
e.g. something like this. You could abstract out the conversion into a method if needed.
Is your feature request related to a problem? Please describe.
Allow adjustment of the
JsonSerializerSettings
inJObjectHelper
that is used byJsonSnapshotStore
, so that snapshots can be made more readable e.g. when using custom JsonConverters they are taken into account.e.g. an example of the current behaviour
after allowing to add converters for instance
Describe the solution you'd like
Not yet full thought through, but maybe
**CustomSnapshotSerialzation**
that could expose either the completeJsonSerializerSettings
orhooks
to be called by the default implementation when adding converters.What would be great is to at least be able to add the following
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: