Creates a new YamlSerializerOptions based on this context's options with the specified overrides applied, while preserving the TypeInfoResolver.
public YamlSerializerOptions CreateOptions(Func<YamlSerializerOptions, YamlSerializerOptions> configure)
A function that applies overrides to a copy of this context's options using the with expression.
var options = context.CreateOptions(o => o with { SourceName = "config.yaml" });
var result = YamlSerializer.Deserialize<Config>(yaml, options);
This is useful when you need per-call option variations (such as a different SourceName for each file) while reusing the same source-generated context.
If the overrides include runtime Converters, generated contexts resolve supported converter replacements when a generated YamlTypeInfo is initialized. Reuse that YamlTypeInfo for repeated operations with the same converter set to avoid reinitializing option-specific generated metadata.
The returned options always has TypeInfoResolver set to this context.
Any TypeInfoResolver value set by configure is overwritten.