Fix to_json failure on exclusions array.

[Fixes #52886751]