In order to avoid parsing the whole YAML or monkeypatching HashWithIndifferentAccess the easiest workaround is to convert to JSON then parse back to YAML
Related issues
Bug #23382: Editing Smart Class Parameter of type YAML creates malformed value in release 1.17.0
Fixes #23382 - Hashes in arrays are shown properly on ENC
When defining smart class parameter values with type YAML and submitted
in GUI an Ruby error message gets prepended for each array entry.
Defining an YAML-Array like:
---
- name: foo
mount_point: /bar
- name: john
mount_point: /doe
is shown on the ENC as:
- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
name: foo
mount_point: "/bar"
- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
name: john
mount_point: "/doe"
In order to avoid parsing the whole YAML or monkeypatching
HashWithIndifferentAccess the easiest workaround is to convert to
JSON then parse back to YAML