yaml-rust icon indicating copy to clipboard operation
yaml-rust copied to clipboard

Tags on mappings and sequences

Open ExpHP opened this issue 5 years ago • 1 comments

Currently, tags are only emitted on Scalar events, and not on MappingStart or SequenceStart. This in turn leads to a shortcoming in serde_yaml where tags cannot be used on array-like variants of an enum.

!vec3 [1.0, 0.5, 0.3]

Notice that libyaml supports tags on all three of these events.

This will be a breaking change, as it will require adding new fields to pub enum Event.

ExpHP avatar Jan 17 '20 20:01 ExpHP

If you end up implementing this, please do it in a way that one can deserialize yaml that contains arbitrary tags and serialize it again with the same tags, without losing information.

kosta avatar Jul 21 '22 11:07 kosta