YamlSourceGenerationOptionsAttribute Class

Definition

Assembly SharpYaml.dll
Inherits ObjectAttributeYamlAttribute
Show inherited members (42)

Specifies the default YamlSerializerOptions used by a source-generated YamlSerializerContext.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class YamlSourceGenerationOptionsAttribute : YamlAttribute

Remarks

This attribute is inspired by System.Text.Json's JsonSourceGenerationOptionsAttribute, but targets YamlSerializerOptions instead.

The SharpYaml source generator reads this attribute at compile time and emits a context that constructs an immutable YamlSerializerOptions instance. The generated context expects the same options instance to be used consistently at runtime.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (18)