fixes #9240 - in case of hash with indifferent access, serialize as hash
(cherry picked from commit 3059cea1c207718217f07b9cdc706bc516f5db1b)
fixes #9240 - in case of hash with indifferent access, serialize as hash
(cherry picked from commit 3059cea1c207718217f07b9cdc706bc516f5db1b)