Yams icon indicating copy to clipboard operation
Yams copied to clipboard

Adds the ability to access a Node's `tag` during decoding

Open ssgutierrez42 opened this issue 4 years ago • 0 comments

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.

ssgutierrez42 avatar Apr 11 '22 18:04 ssgutierrez42