NHSDigital / ndr_support

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

YAMLSupport should preserve escape sequences in JSON text #42

Closed bshand closed 11 months ago

bshand commented 11 months ago

Our support for historical syck YAML is unintentionally converting control sequences in JSON data into control characters. For example, the clean ASCII string ' \x09 ' [space][backslash][x][0][9][space] is being converted into [space][tab][space].

We really need to fix this better, to also not transform psych YAML in this way, but that needs further work, and may affect other code, so may need a minor / major ndr_support version bump.

This fix should affect only JSON data, so should be safe for a minor bump.

Related tickets: https://ncr.plan.io/issues/2410 and https://nhsd-jira.digital.nhs.uk/browse/NDRS2-113 and https://ncr.plan.io/issues/34564

[The linting error is existing code that I've left unchanged.]