You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some people have raised issues (#39, #58) that reference the same basic issue: how do you pretty-print JSON while compressing all children that satisfy condition X. This could mean things like:
I want to pretty-print my file, but compress the values associated with key foo
I want to compress my file, but pretty-print every array with length less than 4
and so forth.
If you want something like that, do not raise an issue, and instead read this tutorial. I will close any issue that I think looks like that, because I do not feel like adding and maintaining features that might satisfy such requests, especially when a perfectly adequate solution already exists.
Many problems of this form can be solved using JsonTools, but you need to use RemesPath. Here's how:
Pretty-print or compress your document according to how you want to format things that do not satisfy condition X.
Open the tree view.
Use RemesPath to match everything that satisfies condition X. You can check the tree view to make sure your query does what you want.
Right-click the root tree node, and choose the Select all children option from the drop-down menu that appears.
Choose the Pretty-print current JSON file or Compress current JSON file option to format only the JSON that is currently selected.
The JSON that satisfy condition X is now formatted differently from the rest of the file.
Some people have raised issues (#39, #58) that reference the same basic issue: how do you pretty-print JSON while compressing all children that satisfy condition X. This could mean things like:
foo
and so forth.
If you want something like that, do not raise an issue, and instead read this tutorial. I will close any issue that I think looks like that, because I do not feel like adding and maintaining features that might satisfy such requests, especially when a perfectly adequate solution already exists.
Many problems of this form can be solved using JsonTools, but you need to use RemesPath. Here's how:
Select all children
option from the drop-down menu that appears.Pretty-print current JSON file
orCompress current JSON file
option to format only the JSON that is currently selected.Worked Example
Suppose you have the following JSON:
and you want to pretty-print the document, but compress all the arrays with length less than 10 that are children of the
bar
key.You would follow these steps:
bar
key with length less than 10 using the query@[:].bar[and(type(@) == array, len(@) < 10)]
Select all children
option from the drop-down.Compress current JSON file
command, and the arrays that satisfy condition X will be compressed without affecting the rest of the document.The text was updated successfully, but these errors were encountered: