JSON 'minification' makes file comparison nearly impossible

MartijnPW

New Member
Hi,

I am trying to upgrade from OBS 25.0.8 to 27.1.3. I happen to work in quite a complicated setup with 5+ PCs that all need to run OBS, so I sometimes need to to do file comparisons between the JSON configs that OBS reads/writes. I use BeyondCompare for this, and it used to work great in the past.

However, in 27.x it seems that the JSON files are 'minified' so that it all fits onto one line. This makes it impossible to do any sensible file comparison, as you can see in the attached screenshot, where an old file is compared to a new file.

Why was this change done anyway? Should it be faster to read or something?

Could we at least have an option to write 'pretty' JSON files? That would be great!

BTW I'm sure the same issue will be present when putting these JSON files in a version control system, and handling merge conflicts in such a situation.
 

Attachments

  • Minified JSON comparison.png
    Minified JSON comparison.png
    90.2 KB · Views: 41
I use a JSON formatter to expand minified files when I need to examine them. I like the JSTool plugin to Notepad++, which is a fine text editor in any case.
 
Last edited:

MartijnPW

New Member
Hi John, thanks for the workaround tip!
I'm still hoping for a more permanent / user-friendly solution though :)
 
I just tried the BeyondCompare "sorted" and "tidied" JSON plugins. They handle minified JSON just fine (displaying as prettified)

However, if you have done anything in OBS (even just selecting a different scene in preview) between saves, the order of elements in the "sources" array changes, and the compare can be pretty useless.

As for putting JSON files (or at least OBS JSON files) in version control, I think you would need to treat them like binary assets where merge is not an option.
 

DeaVain

New Member
I have had a look with a few JSON tools and it all looks a bit, weird. Basically I'd definitely concur, for the moment, treat them as a binary resource.

But I'm going to pursue a bit, so I'll write back if I find anything.
 
Top