{"action":"opened","issue":{"url":"https://api.github.com/repos/jishi/node-sonos-http-api/issues/384","repository_url":"https://api.github.com/repos/jishi/node-sonos-http-api","labels_url":"https://api.github.com/repos/jishi/node-sonos-http-api/issues/384/labels{/name}","comments_url":"https://api.github.com/repos/jishi/node-sonos-http-api/issues/384/comments","events_url":"https://api.github.com/repos/jishi/node-sonos-http-api/issues/384/events","html_url":"https://github.com/jishi/node-sonos-http-api/issues/384","id":191660228,"number":384,"title":"use swagger file to control actions","user":{"login":"antxxxx","id":2149559,"avatar_url":"https://avatars.githubusercontent.com/u/2149559?v=3","gravatar_id":"","url":"https://api.github.com/users/antxxxx","html_url":"https://github.com/antxxxx","followers_url":"https://api.github.com/users/antxxxx/followers","following_url":"https://api.github.com/users/antxxxx/following{/other_user}","gists_url":"https://api.github.com/users/antxxxx/gists{/gist_id}","starred_url":"https://api.github.com/users/antxxxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antxxxx/subscriptions","organizations_url":"https://api.github.com/users/antxxxx/orgs","repos_url":"https://api.github.com/users/antxxxx/repos","events_url":"https://api.github.com/users/antxxxx/events{/privacy}","received_events_url":"https://api.github.com/users/antxxxx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-25T09:38:14Z","updated_at":"2016-11-25T09:38:14Z","closed_at":null,"body":"Have you considered having a swagger document to describe the endpoints? I know you are using swagger-ui to provide a gui to show a nice page to try out the api, but looking at this you have hard coded the definition in static/docs/index.html rather than reading from a swagger file   \r\n\r\n If you do have a swagger file, you can then use a framework like swagger-restify-mw or swagger-express-mw which uses the swagger file to control how the api behaves - ie if you want a new endpoint you add it to the swagger document and your documentation is updated and the new endpoint is automatically exposed - you just need to write the code to implement it, so you no longer need to read all files in lib/actions directory to work out the actions available.   \r\n\r\nIt also means it is easy to expose endpoints using different http verbs - eg you could have endpoint /zones/{zoneName}/queue and call GET to see what is in the queue, DELETE to clear the queue, PATCH to add something to the queue and POST to replace the queue - although this would obviously be a breaking change to current behaviour."}}
{"actor":{"display_login":"antxxxx"}}