Class YamlFormatterOptions
- Assembly
- Codebelt.Extensions.YamlDotNet.dll
Configuration options for YamlFormatter.
public class YamlFormatterOptions : EncodingOptions, IEncodingOptions, IExceptionDescriptorOptions, IContentNegotiation, IValidatableParameterObject, IParameterObject
- Inheritance
-
ObjectYamlFormatterOptions
- Implements
- Inherited Members
- Extension Methods
Constructors
YamlFormatterOptions()
Initializes a new instance of the YamlFormatterOptions class.
public YamlFormatterOptions()
Remarks
The following table shows the initial property values for an instance of YamlFormatterOptions.
Property | Initial Value |
---|---|
Settings | new YamlSerializerOptions(); |
SensitivityDetails | None |
SupportedMediaTypes |
|
Properties
DefaultConverters
Gets or sets a delegate that is invoked when YamlFormatterOptions is initialized and propagates registered YamlConverter implementations.
public static Action<IList<YamlConverter>> DefaultConverters { get; set; }
Property Value
- Action<IList<YamlConverter>>
The delegate which propagates registered YamlConverter implementations when YamlFormatterOptions is initialized.
DefaultMediaType
Provides the default/fallback media type that the associated formatter should use when content negotiation either fails or is absent.
public static MediaTypeHeaderValue DefaultMediaType { get; }
Property Value
- MediaTypeHeaderValue
The media type that the associated formatter should use when content negotiation either fails or is absent.
SensitivityDetails
Gets or sets a bitwise combination of the enumeration values that specify which sensitive details to include in the serialized result.
public FaultSensitivityDetails SensitivityDetails { get; set; }
Property Value
- FaultSensitivityDetails
The enumeration values that specify which sensitive details to include in the serialized result.
Settings
Gets or sets the settings to support the YamlConverter.
public YamlSerializerOptions Settings { get; set; }
Property Value
- YamlSerializerOptions
A YamlSerializerOptions instance that specifies a set of features to support the YamlConverter object.
SupportedMediaTypes
Gets or sets the collection of System.Net.Http.Headers.MediaTypeHeaderValue elements supported by the YamlFormatter.
public IReadOnlyCollection<MediaTypeHeaderValue> SupportedMediaTypes { get; set; }
Property Value
- IReadOnlyCollection<MediaTypeHeaderValue>
A collection of System.Net.Http.Headers.MediaTypeHeaderValue elements supported by the YamlFormatter.
Methods
ValidateOptions()
Determines whether the public read-write properties of this instance are in a valid state.
public void ValidateOptions()
Remarks
This method is expected to throw exceptions when one or more conditions fails to be in a valid state.
Exceptions
- System.InvalidOperationException
Settings cannot be null.