{"action":"closed","issue":{"url":"https://api.github.com/repos/CachetHQ/Cachet/issues/1842","repository_url":"https://api.github.com/repos/CachetHQ/Cachet","labels_url":"https://api.github.com/repos/CachetHQ/Cachet/issues/1842/labels{/name}","comments_url":"https://api.github.com/repos/CachetHQ/Cachet/issues/1842/comments","events_url":"https://api.github.com/repos/CachetHQ/Cachet/issues/1842/events","html_url":"https://github.com/CachetHQ/Cachet/issues/1842","id":157163606,"number":1842,"title":"POST /metrics request/response field mismatch","user":{"login":"dhorbach","id":1785851,"avatar_url":"https://avatars.githubusercontent.com/u/1785851?v=3","gravatar_id":"","url":"https://api.github.com/users/dhorbach","html_url":"https://github.com/dhorbach","followers_url":"https://api.github.com/users/dhorbach/followers","following_url":"https://api.github.com/users/dhorbach/following{/other_user}","gists_url":"https://api.github.com/users/dhorbach/gists{/gist_id}","starred_url":"https://api.github.com/users/dhorbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhorbach/subscriptions","organizations_url":"https://api.github.com/users/dhorbach/orgs","repos_url":"https://api.github.com/users/dhorbach/repos","events_url":"https://api.github.com/users/dhorbach/events{/privacy}","received_events_url":"https://api.github.com/users/dhorbach/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/CachetHQ/Cachet/milestones/23","html_url":"https://github.com/CachetHQ/Cachet/milestones/V2.3.0","labels_url":"https://api.github.com/repos/CachetHQ/Cachet/milestones/23/labels","id":1680175,"number":23,"title":"V2.3.0","description":"","creator":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":143,"state":"open","created_at":"2016-04-03T10:51:18Z","updated_at":"2016-06-03T12:54:30Z","due_on":"2016-05-28T23:00:00Z","closed_at":null},"comments":2,"created_at":"2016-05-27T09:14:28Z","updated_at":"2016-06-03T12:54:30Z","closed_at":"2016-06-03T12:54:30Z","body":"Before submitting your issue, please make sure that you've checked all of the checkboxes below.\r\n\r\n- [x] You're running the [latest release](https://github.com/CachetHQ/Cachet/releases/latest) version of Cachet.\r\n- [x] Ensure that you're running at least PHP 5.5.9, you can check this by running `php -v`\r\n- [x] You've ran `rm -rf bootstrap/cache/*` from the root of your Cachet installation.\r\n\r\nTo help us better understand your issue, please answer the following — cheers!\r\n\r\n### Your setup\r\n\r\n- *What version of Cachet?*\r\n2.2.2\r\n- *What database driver? MySQL? Postgres? SQLite?*\r\nMySQL\r\n- *What version of PHP?*\r\n5.5.9\r\n\r\n### Expected behaviour\r\n\r\nInput fields for /metrics API matches output fields\r\n\r\n### Actual behaviour\r\n\r\nPOST /metrics has \"view\" parameter\r\nResult has \"default_view\" parameter.\r\n\r\nCan we make them the same? Is there some specific convention?\r\nNo documentation on this field too.\r\n\r\n### Steps to reproduce\r\n\r\nPOST /metrics\r\n```\r\n{\r\n    \"name\":\"Visitors7\",\r\n    \"description\":\"How many visitors\",\r\n    \"suffix\":\"Visitors per hour\",\r\n    \"default_value\":\"0\",\r\n    \"display_chart\":\"1\",\r\n    \"view\": 2\r\n}\r\n```\r\nResponse:\r\n```\r\n{\r\n  \"data\": {\r\n    \"name\": \"Visitors7\",\r\n    \"display_chart\": true,\r\n    \"default_value\": 0,\r\n    \"calc_type\": 0,\r\n    \"places\": 2,\r\n    \"default_view\": 2,\r\n    \"suffix\": \"Visitors per hour\",\r\n    \"description\": \"How many visitors\",\r\n    \"updated_at\": \"2016-05-27 05:09:32\",\r\n    \"created_at\": \"2016-05-27 05:09:32\",\r\n    \"id\": 16\r\n  }\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"jbrooksuk"}}