fixes #7015 - to_json passes options through correctly, remove array wrapping

(cherry picked from commit d7105481eb26bc9eb1b7d2f4d0b8542aa0d43bca)