{"action":"created","issue":{"url":"https://api.github.com/repos/civitaslearning/go-restful/issues/1","repository_url":"https://api.github.com/repos/civitaslearning/go-restful","labels_url":"https://api.github.com/repos/civitaslearning/go-restful/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/civitaslearning/go-restful/issues/1/comments","events_url":"https://api.github.com/repos/civitaslearning/go-restful/issues/1/events","html_url":"https://github.com/civitaslearning/go-restful/pull/1","id":154493366,"number":1,"title":"Fix JSON indentation","user":{"login":"dkolbly","id":1017053,"avatar_url":"https://avatars.githubusercontent.com/u/1017053?v=3","gravatar_id":"","url":"https://api.github.com/users/dkolbly","html_url":"https://github.com/dkolbly","followers_url":"https://api.github.com/users/dkolbly/followers","following_url":"https://api.github.com/users/dkolbly/following{/other_user}","gists_url":"https://api.github.com/users/dkolbly/gists{/gist_id}","starred_url":"https://api.github.com/users/dkolbly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkolbly/subscriptions","organizations_url":"https://api.github.com/users/dkolbly/orgs","repos_url":"https://api.github.com/users/dkolbly/repos","events_url":"https://api.github.com/users/dkolbly/events{/privacy}","received_events_url":"https://api.github.com/users/dkolbly/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-12T14:14:56Z","updated_at":"2016-05-12T17:21:54Z","closed_at":"2016-05-12T17:20:30Z","pull_request":{"url":"https://api.github.com/repos/civitaslearning/go-restful/pulls/1","html_url":"https://github.com/civitaslearning/go-restful/pull/1","diff_url":"https://github.com/civitaslearning/go-restful/pull/1.diff","patch_url":"https://github.com/civitaslearning/go-restful/pull/1.patch"},"body":"@civitaslearning/platform A long-standing annoyance for me... we return incorrectly indented JSON because at the time I added this to go-restful, I didn't understand the correct usage of `json.MarshalIndent`.\r\n\r\nAs a result, we get back stuff that looks like this:\r\n```\r\n$ curl http://api.private.civitaslearning.com/import/v1/version\r\n{\r\n  \"version\": \"1.0.1.457\",\r\n  \"service\": \"import\",\r\n  \"build\": {\r\n   \"commit\": \"99a3f8b49b3a0e50e623b25c6cbaee54dd3761c8 origin/master\",\r\n   \"build_time\": \"2016-04-21T22:37:14Z\"\r\n  }\r\n }\r\n$\r\n```\r\nnote the final `}` with a space before it.\r\n"},"comment":{"url":"https://api.github.com/repos/civitaslearning/go-restful/issues/comments/218826071","html_url":"https://github.com/civitaslearning/go-restful/pull/1#issuecomment-218826071","issue_url":"https://api.github.com/repos/civitaslearning/go-restful/issues/1","id":218826071,"user":{"login":"dkolbly","id":1017053,"avatar_url":"https://avatars.githubusercontent.com/u/1017053?v=3","gravatar_id":"","url":"https://api.github.com/users/dkolbly","html_url":"https://github.com/dkolbly","followers_url":"https://api.github.com/users/dkolbly/followers","following_url":"https://api.github.com/users/dkolbly/following{/other_user}","gists_url":"https://api.github.com/users/dkolbly/gists{/gist_id}","starred_url":"https://api.github.com/users/dkolbly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkolbly/subscriptions","organizations_url":"https://api.github.com/users/dkolbly/orgs","repos_url":"https://api.github.com/users/dkolbly/repos","events_url":"https://api.github.com/users/dkolbly/events{/privacy}","received_events_url":"https://api.github.com/users/dkolbly/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T17:21:54Z","updated_at":"2016-05-12T17:21:54Z","body":"@troy-civitas I think the trick is to use a lower-level response writer; it's `WriteEntity()` that is doing the conversion (I think go-restful knows that the request wants a JSON response, or maybe that the endpoint is configured to return JSON, so renders the entity as JSON).  But there's a way to bypass the go-restful layer I'm pretty sure."}}