BHoM_Engine icon indicating copy to clipboard operation
BHoM_Engine copied to clipboard

Serializer_Engine: PrettyPrint json when exposed to UI

Open epignatelli opened this issue 7 years ago • 1 comments
trafficstars

Using mongo drivers obj.ToJson(new JsonWriterSettings { Indent = true });

It would help a lot for debugging, instead of using Explode

epignatelli avatar Oct 01 '18 10:10 epignatelli

Having reviewed this historic issue, I think it is worth still having this for some application. However, I don't think it should be part of the ToJson method (which now isn't using the things suggested in the original issue since the updates to Serialiser_Engine in early 2023) because that is used internally for several things where pretty printing the output string isn't relevant.

Instead, to resolve this, I propose a new method which takes in a JSON string and returns a formatted version which becomes human readable which can then be used in UIs as desired. It adds another component to the process, but keeps the ToJson method focused on generating the JSON and not worrying about its display for human or computer use.

FraserGreenroyd avatar Jan 04 '24 11:01 FraserGreenroyd