Closed sypste closed 10 months ago
Would writing a toJson and join lambda in "user space" work for your use case? That should give you full control over your desired functionality without changing behavior for non-elastic search users.
https://github.com/noahmorrison/chevron/blob/90413a2dd56e06e1a493aa703907febe43966ca3/test_spec.py#L289-L310 for reference.
Any thoughts or additional requirements? Thanks!
That should work for the use case, if I can offer any help feel free to get in touch
One use case for mustache is building parameterized search templates for Elasticsearch. The rendering engine in Elasticsearch has two special built-in functions/annotations:
{{#toJson}}some-object{{/toJson}} renders the nested object to valid JSON, and {{#join}}some-array{{/join}} concatenates the strings in the array to a single string with a default or custom delimiter. Could chevron implement those annotations as well? Asking for a friend :)