Class HumlExtensionDataAttribute

Namespace
Huml.Net.Serialization
Assembly
Huml.Net.dll

Designates a single property as the overflow bucket for HUML keys that do not match any declared property during deserialisation.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class HumlExtensionDataAttribute : Attribute
Inheritance
HumlExtensionDataAttribute
Inherited Members

Remarks

The decorated property must be of type Dictionary<string, HumlNode> or Dictionary<string, object?>. Applying this attribute to a property of any other type causes InvalidOperationException to be thrown at first use (descriptor build time).

Only one property per type hierarchy may carry [HumlExtensionData]. Declaring it on more than one property causes InvalidOperationException to be thrown at first use with a message identifying the type and both property names.

During deserialisation, every HUML mapping key that does not correspond to a declared property is captured into the annotated dictionary. Keys are stored verbatim; no naming-policy transform is applied. Declared properties continue to bind normally.

During serialisation, extension keys are emitted after all declared properties in insertion order, using the same key-quoting rules as declared properties.