Yams
Yams copied to clipboard
Adds the ability to access a Node's `tag` during decoding
Summary
Enables access of a Node's tag:
e.g. !DanceEvent
structure:
version: 0.1.0
actions:
8a139ac7: !DanceEvent
type: happy
During the decoding function of Codable objects:
required init(from decoder: Decoder) throws {
...
print("\(decoder.tag)") //!DanceEvent
...
Background
See https://github.com/jpsim/Yams/issues/265
Enables an avenue to decode polymorphic types.