Open syte opened 6 years ago
Is that from just putting a hash directly into a template? I don't think I really covered that case---I have a default stringification method for that but it is not very robust.
I can probably add a hook for a JSON serializer into the initialization so that it doesn't take a dependency on NewtonSoft.
@mikebridge , yes it's from putting the hash directly into the template. I do like your idea of being able to add a hook for serialization.
Currently whenever I dump a liquid hash, it serializes empty enumerables into nothing. Also, enumerables aren't wrapped in brackets, and each item in the list isn't being separated from the next with a comma.
Example:
{ facets: , results: { name: 'Test' } { name: 'Test2' } }
Expected value:
{ facets: [], results: [{ name: 'Test' }, { name: 'Test2' }] }