Add GetOptions method to ISafeSerializer interface

This new method retrieves the JSON serializer options, enhancing flexibility in how JSON data is handled. It provides an additional way to customize serialization settings contextually.
This commit is contained in:
Sipke Schoorstra 2024-09-27 13:10:22 +02:00
parent 7d45db355d
commit 750b4804fe

View file

@ -59,4 +59,9 @@ public interface ISafeSerializer
/// </summary>
[RequiresUnreferencedCode("The type T may be trimmed.")]
T Deserialize<T>(JsonElement element, CancellationToken cancellationToken = default);
/// <summary>
/// Gets the JSON serializer options.
/// </summary>
JsonSerializerOptions GetOptions();
}