luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.57k stars 156 forks source link

More accurately parse json values for params #1661

Closed matthewmcgarvey closed 2 years ago

matthewmcgarvey commented 2 years ago

Purpose

In the cases where the value of a json field is a JSON object, it was inaccurately returning the string representation of the hash instead of the JSON object. So, instead of calling .to_s on JSON::Any we call .to_json with one caveat and that is String values. Calling .to_json on a string wraps the string in escaped quotes.