NHSDigital / ndr_support

National Disease Registers support gem
MIT License
4 stars 6 forks source link

Allow YAML aliases when using `yaml_safe_classes` #46

Closed bshand closed 9 months ago

bshand commented 9 months ago

We need to allow aliases in our YAML parsing.

The standard YAML emitter will introduce aliases in its output if there are repeated references in nested structures. Some of these are unavoidable, e.g. multiple references to the same date object. Sample YAML (observed in practice) might contain something like:

attendances:
- appointmentdate: &1 !ruby/object:DateTime 2023-01-01 00:00:00.000000000 Z
  appointmenttime: '11:15:00'
- appointmentdate: *1
  appointmenttime: '11:15:00'