databricks / sjsonnet

Apache License 2.0
266 stars 54 forks source link

fix: std.manifestJsonMinified and empty arrays/objects. #207

Closed rudo-thomas closed 1 hour ago

rudo-thomas commented 3 months ago

Problem: std.manifestJsonMinified was producing newlines in empty arrays or empty objects:

$ jsonnet -e 'std.manifestJsonMinified({a:[],b:{}})'
"{\"a\":[],\"b\":{}}"

$ sjsonnet-0.4.10 -e 'std.manifestJsonMinified({a:[],b:{}})'
"{\"a\":[\n],\"b\":{\n}}"

Fix that and update the tests too.