{"action":"created","issue":{"url":"https://api.github.com/repos/zold-io/wts.zold.io/issues/42","repository_url":"https://api.github.com/repos/zold-io/wts.zold.io","labels_url":"https://api.github.com/repos/zold-io/wts.zold.io/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/zold-io/wts.zold.io/issues/42/comments","events_url":"https://api.github.com/repos/zold-io/wts.zold.io/issues/42/events","html_url":"https://github.com/zold-io/wts.zold.io/issues/42","id":339131047,"node_id":"MDU6SXNzdWUzMzkxMzEwNDc=","number":42,"title":"Use JSON instead of text/plain","user":{"login":"botanicus","id":6171,"node_id":"MDQ6VXNlcjYxNzE=","avatar_url":"https://avatars2.githubusercontent.com/u/6171?v=4","gravatar_id":"","url":"https://api.github.com/users/botanicus","html_url":"https://github.com/botanicus","followers_url":"https://api.github.com/users/botanicus/followers","following_url":"https://api.github.com/users/botanicus/following{/other_user}","gists_url":"https://api.github.com/users/botanicus/gists{/gist_id}","starred_url":"https://api.github.com/users/botanicus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botanicus/subscriptions","organizations_url":"https://api.github.com/users/botanicus/orgs","repos_url":"https://api.github.com/users/botanicus/repos","events_url":"https://api.github.com/users/botanicus/events{/privacy}","received_events_url":"https://api.github.com/users/botanicus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-07T09:10:23Z","updated_at":"2018-07-07T23:07:27Z","closed_at":"2018-07-07T22:52:14Z","author_association":"NONE","body":"JSON is the standard for web app APIs. If we plan to allow other users to use the `wts.zold.io` API, we should expose it in the (most) standard format.\r\n\r\nEven if we don’t, there are other good reasons to use JSON:\r\n\r\nAs of now, `GET /version` returns `VERSION` as a string. That’s perfectly reasonable, but say that as we exposed `Zold::PROTOCOL`, we might want to expose that in here as well (or we might _not_, but I’ll just use it as an example).\r\n\r\nWith `text/plain` there are realistically 2 ways of implementing this:\r\n1. `GET /version` could return `version: a.b.c\\nprotocol: x.y.z`. Now we’re inventing a custom non-standard key-value format. This is obviously not DRY and not preferable in my view.\r\n2. We expose _additional endpoint_ that exposes just `Zold::PROTOCOL` and keep `GET /versión` intact. That’s better, but we end up with unnecessary endpoints.\r\n3. `GET /version` returns `{\"version\": \"a.b.c\", \"protocol\": \"x.y.z\"}`. This is my suggestion. We ended up with less complexity and therefore more maintainable code.\r\n\r\nAnd imagine we switch from a server-side generate app to say React.js. If we stuck to JSON, it'll be easier to implement than both option 1 and 2.\r\n\r\nAnd we don't have to deal with bugs such as #36: even though one must encode/decode JSON, lack of doing so will make the code _always fail immediately_ as they are of a different type. It's not a string that we might or might not have forgotten to decode, it's either a structure such as Hash or Array or it's a String."},"comment":{"url":"https://api.github.com/repos/zold-io/wts.zold.io/issues/comments/403248635","html_url":"https://github.com/zold-io/wts.zold.io/issues/42#issuecomment-403248635","issue_url":"https://api.github.com/repos/zold-io/wts.zold.io/issues/42","id":403248635,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzI0ODYzNQ==","user":{"login":"0crat","id":24387511,"node_id":"MDQ6VXNlcjI0Mzg3NTEx","avatar_url":"https://avatars1.githubusercontent.com/u/24387511?v=4","gravatar_id":"","url":"https://api.github.com/users/0crat","html_url":"https://github.com/0crat","followers_url":"https://api.github.com/users/0crat/followers","following_url":"https://api.github.com/users/0crat/following{/other_user}","gists_url":"https://api.github.com/users/0crat/gists{/gist_id}","starred_url":"https://api.github.com/users/0crat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0crat/subscriptions","organizations_url":"https://api.github.com/users/0crat/orgs","repos_url":"https://api.github.com/users/0crat/repos","events_url":"https://api.github.com/users/0crat/events{/privacy}","received_events_url":"https://api.github.com/users/0crat/received_events","type":"User","site_admin":false},"created_at":"2018-07-07T23:07:27Z","updated_at":"2018-07-07T23:07:27Z","author_association":"NONE","body":"The job is not in WBS, won't close the order\n\n<!-- https://www.0crat.com/footprint/CB28FH2NR/1882316330, version: 0.25.2, hash: ${buildNumber} -->"}}
{"actor":{"display_login":"0crat"}}