{"action":"created","issue":{"url":"https://api.github.com/repos/timothycrosley/hug/issues/170","repository_url":"https://api.github.com/repos/timothycrosley/hug","labels_url":"https://api.github.com/repos/timothycrosley/hug/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/timothycrosley/hug/issues/170/comments","events_url":"https://api.github.com/repos/timothycrosley/hug/issues/170/events","html_url":"https://github.com/timothycrosley/hug/issues/170","id":130973008,"number":170,"title":"Semantic versioning support","user":{"login":"timothycrosley","id":2090154,"avatar_url":"https://avatars.githubusercontent.com/u/2090154?v=3","gravatar_id":"","url":"https://api.github.com/users/timothycrosley","html_url":"https://github.com/timothycrosley","followers_url":"https://api.github.com/users/timothycrosley/followers","following_url":"https://api.github.com/users/timothycrosley/following{/other_user}","gists_url":"https://api.github.com/users/timothycrosley/gists{/gist_id}","starred_url":"https://api.github.com/users/timothycrosley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothycrosley/subscriptions","organizations_url":"https://api.github.com/users/timothycrosley/orgs","repos_url":"https://api.github.com/users/timothycrosley/repos","events_url":"https://api.github.com/users/timothycrosley/events{/privacy}","received_events_url":"https://api.github.com/users/timothycrosley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/timothycrosley/hug/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-03T09:50:49Z","updated_at":"2016-02-03T10:24:52Z","closed_at":null,"body":"Right now hug only supports versioning on a straight numeric value, this works fairly well in most cases where no breaking changes happen between major releases, however it can occasionally fall apart - which unfortunately could lead to the hug API version not staying at all in sync with the codes semantic version. It would be beneficial to support semantic versioning routes natively in hug. One potential way to do this would be to allow a length 3 tuple to be passed into the tuple in addition to a straight int. A convenience named tuple object could be added to make usage explicit:\r\n\r\n    @hug.get(versions=hug.version(major=3, minor=2))\r\n    def endpoint():\r\n       pass\r\n\r\nthanks @vortec for the idea!"},"comment":{"url":"https://api.github.com/repos/timothycrosley/hug/issues/comments/179149520","html_url":"https://github.com/timothycrosley/hug/issues/170#issuecomment-179149520","issue_url":"https://api.github.com/repos/timothycrosley/hug/issues/170","id":179149520,"user":{"login":"vortec","id":864772,"avatar_url":"https://avatars.githubusercontent.com/u/864772?v=3","gravatar_id":"","url":"https://api.github.com/users/vortec","html_url":"https://github.com/vortec","followers_url":"https://api.github.com/users/vortec/followers","following_url":"https://api.github.com/users/vortec/following{/other_user}","gists_url":"https://api.github.com/users/vortec/gists{/gist_id}","starred_url":"https://api.github.com/users/vortec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vortec/subscriptions","organizations_url":"https://api.github.com/users/vortec/orgs","repos_url":"https://api.github.com/users/vortec/repos","events_url":"https://api.github.com/users/vortec/events{/privacy}","received_events_url":"https://api.github.com/users/vortec/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T10:24:52Z","updated_at":"2016-02-03T10:24:52Z","body":"This is a very good idea!\r\n\r\nDue the nature of semantic versioning, where every bugfix means a new patch version, you will likely end up with more distinct versions than currently.\r\nThis means that developers must delete old endpoints from time to time. To make this task easier, I think it's essential to have hug compile a list of all existing versions and their corresponding endpoints.\r\n\r\nAlso you could make the usage even more explicit (and save some keystrokes) by introducing a ``semver`` type:\r\n\r\n    @hug.get(versions=hug.semver(3, 2))\r\n    def endpoint():\r\n       pass"}}