Skip to content

Fix serde for `Values` with optional `Type`s

Attention: these changes induce breaking changes for the serde representation of some types.

Serialization of Values used to rely on the get function followed by an unwrap. This means that optional types couldn't be serialized when they were None.

This commit distinguishes between the optional Value Types and the ones that always return some value.

The Values, Structure fields and Tags with following types are now represented as Options:

  • Buffer
  • DateTime
  • Sample (note: this type is used for Tag images)
  • String (except for Tags - see the comment in tags_serde.rs).

The representations for these Types remain unchanged when they are used in-place (not as part of a Value).

Also implemented ser / de for Values, Structure fields and Tags with Type Date.

Fixes #215 (closed)

Edited by François Laignel

Merge request reports