merge method
Merges the current JsonSerializerOptions with the provided options
.
Returns a new JsonSerializerOptions instance.
Implementation
JsonSerializerOptions merge(JsonSerializerOptions? options) {
if (options == null) {
return JsonSerializerOptions(
types: [...types],
converters: [...converters],
);
}
return JsonSerializerOptions(
types: [...types, ...options.types],
converters: [...converters, ...options.converters],
);
}