{"id":356,"date":"2016-07-09T07:28:18","date_gmt":"2016-07-08T21:28:18","guid":{"rendered":"http:\/\/chuchuva.com\/pavel\/?p=356"},"modified":"2016-07-10T15:05:59","modified_gmt":"2016-07-10T05:05:59","slug":"viewing-json","status":"publish","type":"post","link":"https:\/\/chuchuva.com\/pavel\/2016\/07\/viewing-json\/","title":{"rendered":"Viewing JSON"},"content":{"rendered":"<p>From time to time I need to examine data in JSON format. Now unformatted JSON is very hard to read, for example:<\/p>\n<pre><code>{\"movies\":[{\"id\":\"770739679\",\"title\":\"Captain America: The First Avenger\",\"year\":2011,\"mpaa_rating\":\"PG-13\",\"runtime\":121,\"critics_consensus\":\"With plenty of pulpy action, a pleasantly...\",\"release_dates\":{\"theater\":\"2011-07-22\"},\"ratings\":{\"critics_rating\":\"Fresh\",\"critics_score\":71,\"audience_score\":96},\"synopsis\":\"Captain America: The First Avenger will focus on the early days...\",\"posters\":{\"thumbnail\":\"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\",\"profile\":\"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\",\"detailed\":\"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\",\"original\":\"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\"},\"abridged_cast\":[{\"name\":\"Chris Evans\",\"characters\":[\"Captain America\/Steve Rogers\",\"Steve Rogers \/ Captain America\",\"Steve Rogers\/Captain America\"]},{\"name\":\"Hayley Atwell\",\"characters\":[\"Peggy Carter\"]},{\"name\":\"Sebastian Stan\",\"characters\":[\"Bucky Barnes\",\"James Buchanan \\\"Bucky\\\" Barnes\"]},{\"name\":\"Tommy Lee Jones\",\"characters\":[\"Colonel Chester Phillips\"]},{\"name\":\"Hugo Weaving\",\"characters\":[\"Johann Schmidt\/Red Skull\",\"Johann Schmidt\/The Red Skull\",\"Red Skull\"]}],\"alternate_ids\":{\"imdb\":\"0458339\"}}\r\n<\/code><\/pre>\n<p>I usually use <a href=\"https:\/\/jsonviewer.codeplex.com\/\">JSON Viewer<\/a> to format JSON:<\/p>\n<pre><code>{\r\n    \"movies\": [\r\n        {\r\n            \"id\": \"770739679\",\r\n            \"title\": \"Captain America: The First Avenger\",\r\n            \"year\": 2011,\r\n            \"mpaa_rating\": \"PG-13\",\r\n            \"runtime\": 121,\r\n            \"critics_consensus\": \"With plenty of pulpy action...\",\r\n            \"release_dates\": {\r\n                \"theater\": \"2011-07-22\"\r\n            },\r\n            \"ratings\": {\r\n                \"critics_rating\": \"Fresh\",\r\n                \"critics_score\": 71,\r\n                \"audience_score\": 96\r\n            },\r\n            \"synopsis\": \"Captain America: The First Avenger will focus...\",\r\n            \"posters\": {\r\n                \"thumbnail\": \"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\",\r\n                \"profile\": \"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\",\r\n                \"detailed\": \"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\",\r\n                \"original\": \"http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg\"\r\n            },\r\n            \"abridged_cast\": [\r\n                {\r\n                    \"name\": \"Chris Evans\",\r\n                    \"characters\": [\r\n                        \"Captain America\/Steve Rogers\",\r\n                        \"Steve Rogers \/ Captain America\",\r\n                        \"Steve Rogers\/Captain America\"\r\n                    ]\r\n                },\r\n                {\r\n                    \"name\": \"Hayley Atwell\",\r\n                    \"characters\": [\r\n                        \"Peggy Carter\"\r\n                    ]\r\n                },\r\n                {\r\n                    \"name\": \"Sebastian Stan\",\r\n                    \"characters\": [\r\n                        \"Bucky Barnes\",\r\n                        \"James Buchanan \\\"Bucky\\\" Barnes\"\r\n                    ]\r\n                },\r\n                {\r\n                    \"name\": \"Tommy Lee Jones\",\r\n                    \"characters\": [\r\n                        \"Colonel Chester Phillips\"\r\n                    ]\r\n                },\r\n                {\r\n                    \"name\": \"Hugo Weaving\",\r\n                    \"characters\": [\r\n                        \"Johann Schmidt\/Red Skull\",\r\n                        \"Johann Schmidt\/The Red Skull\",\r\n                        \"Red Skull\"\r\n                    ]\r\n                }\r\n            ],\r\n            \"alternate_ids\": {\r\n                \"imdb\": \"0458339\"\r\n            }\r\n        }\r\n    ]\r\n}\r\n<\/pre>\n<p><\/code><\/p>\n<p>Much better isn't it?<\/p>\n<p>JSON Viewer is great because it also shows JSON in a tree:<br \/>\n<a href=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"357\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2016\/07\/viewing-json\/json-viewer\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer.png?fit=935%2C742&amp;ssl=1\" data-orig-size=\"935,742\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer.png?fit=604%2C479&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer.png?resize=604%2C479\" alt=\"JSON Viewer\" width=\"604\" height=\"479\" class=\"alignnone size-full wp-image-357\" srcset=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer.png?w=935&amp;ssl=1 935w, https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer.png?resize=300%2C238&amp;ssl=1 300w, https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer.png?resize=768%2C609&amp;ssl=1 768w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/p>\n<p>Now I can easily expand and collapse elements and quickly understand the structure of the data.<\/p>\n<p>However there is one problem: JSON Viewer doesn't handle large files well. If I try to open 4 MB file it just freezes for few minutes and I have to kill it with Process Explorer.<\/p>\n<p>Do you have the same problem too? How would you like to see the problem solved? Please answer as a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From time to time I need to examine data in JSON format. Now unformatted JSON is very hard to read, for example: {&#8220;movies&#8221;:[{&#8220;id&#8221;:&#8221;770739679&#8243;,&#8221;title&#8221;:&#8221;Captain America: The First Avenger&#8221;,&#8221;year&#8221;:2011,&#8221;mpaa_rating&#8221;:&#8221;PG-13&#8243;,&#8221;runtime&#8221;:121,&#8221;critics_consensus&#8221;:&#8221;With plenty of pulpy action, a pleasantly&#8230;&#8221;,&#8221;release_dates&#8221;:{&#8220;theater&#8221;:&#8221;2011-07-22&#8243;},&#8221;ratings&#8221;:{&#8220;critics_rating&#8221;:&#8221;Fresh&#8221;,&#8221;critics_score&#8221;:71,&#8221;audience_score&#8221;:96},&#8221;synopsis&#8221;:&#8221;Captain America: The First Avenger will focus on the early days&#8230;&#8221;,&#8221;posters&#8221;:{&#8220;thumbnail&#8221;:&#8221;http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg&#8221;,&#8221;profile&#8221;:&#8221;http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg&#8221;,&#8221;detailed&#8221;:&#8221;http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg&#8221;,&#8221;original&#8221;:&#8221;http:\/\/content9.flixster.com\/movie\/11\/15\/83\/11158339_tmb.jpg&#8221;},&#8221;abridged_cast&#8221;:[{&#8220;name&#8221;:&#8221;Chris Evans&#8221;,&#8221;characters&#8221;:[&#8220;Captain America\/Steve Rogers&#8221;,&#8221;Steve Rogers \/ Captain America&#8221;,&#8221;Steve Rogers\/Captain America&#8221;]},{&#8220;name&#8221;:&#8221;Hayley Atwell&#8221;,&#8221;characters&#8221;:[&#8220;Peggy Carter&#8221;]},{&#8220;name&#8221;:&#8221;Sebastian Stan&#8221;,&#8221;characters&#8221;:[&#8220;Bucky &hellip; <a href=\"https:\/\/chuchuva.com\/pavel\/2016\/07\/viewing-json\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Viewing JSON<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[33,34],"class_list":["post-356","post","type-post","status-publish","format-standard","hentry","category-software","tag-json","tag-tool"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":0,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"wp:attachment":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}