FieldTrait

interface FieldTrait

This tag interface provides a mechanism to attach type-specific metadata to any field. See aws.smithy.kotlin.runtime.serde.xml.XmlList for an example implementation.

For example, to specify that a list should be serialized in XML such that values are wrapped in a tag called "boo", pass an instance of XmlList to the FieldDescriptor of XmlList(elementName="boo").

Properties

Link copied to clipboard
open val serialName: String?

The name a field carrying this trait is encoded into on the wire, or null if this trait doesn't name the field. Traits that do carry a name (e.g. JsonSerialName) override this so that resolving a field's wire name stays format-agnostic.