{"action":"created","issue":{"url":"https://api.github.com/repos/perwendel/spark/issues/303","labels_url":"https://api.github.com/repos/perwendel/spark/issues/303/labels{/name}","comments_url":"https://api.github.com/repos/perwendel/spark/issues/303/comments","events_url":"https://api.github.com/repos/perwendel/spark/issues/303/events","html_url":"https://github.com/perwendel/spark/issues/303","id":89591594,"number":303,"title":"declare routes with annotation","user":{"login":"sebastian1118","id":3425280,"avatar_url":"https://avatars.githubusercontent.com/u/3425280?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastian1118","html_url":"https://github.com/sebastian1118","followers_url":"https://api.github.com/users/sebastian1118/followers","following_url":"https://api.github.com/users/sebastian1118/following{/other_user}","gists_url":"https://api.github.com/users/sebastian1118/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastian1118/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastian1118/subscriptions","organizations_url":"https://api.github.com/users/sebastian1118/orgs","repos_url":"https://api.github.com/users/sebastian1118/repos","events_url":"https://api.github.com/users/sebastian1118/events{/privacy}","received_events_url":"https://api.github.com/users/sebastian1118/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-19T15:25:45Z","updated_at":"2015-06-19T15:59:06Z","closed_at":null,"body":"I wonder why Spark does not support annotated route. I dug up some old issue two years ago, and it said it's \"against\" the paradigm Spark stands for.\r\nI understand that. But still declarative route have its advantage:\r\n\r\n* can be attached with javadoc\r\n* easier to navigation in IDE\r\n* make route map more structured\r\n\r\nThe code would look like this. \r\n```java\r\n/**\r\n * book api\r\n */\r\n@Endpoint(path = \"/book\")\r\npublic class BookAPI {\r\n\r\n    /**\r\n     * get book by id\r\n     */\r\n    @Endpoint(path = \"/:id\", methods = HttpMethod.get)\r\n    public static Object get(Request req, Response res) {\r\n\r\n        return \"hello\";\r\n    }\r\n\r\n    public static void main(String... args) {\r\n\r\n        Spark.scan(Arrays.asList(\"spark.examples\"));\r\n\r\n    }\r\n\r\n}\r\n```\r\nIsn't it a good thing to make more options for users. They can choose the style they feel famillar with."},"comment":{"url":"https://api.github.com/repos/perwendel/spark/issues/comments/113556657","html_url":"https://github.com/perwendel/spark/issues/303#issuecomment-113556657","issue_url":"https://api.github.com/repos/perwendel/spark/issues/303","id":113556657,"user":{"login":"chillenious","id":137683,"avatar_url":"https://avatars.githubusercontent.com/u/137683?v=3","gravatar_id":"","url":"https://api.github.com/users/chillenious","html_url":"https://github.com/chillenious","followers_url":"https://api.github.com/users/chillenious/followers","following_url":"https://api.github.com/users/chillenious/following{/other_user}","gists_url":"https://api.github.com/users/chillenious/gists{/gist_id}","starred_url":"https://api.github.com/users/chillenious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chillenious/subscriptions","organizations_url":"https://api.github.com/users/chillenious/orgs","repos_url":"https://api.github.com/users/chillenious/repos","events_url":"https://api.github.com/users/chillenious/events{/privacy}","received_events_url":"https://api.github.com/users/chillenious/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T15:59:06Z","updated_at":"2015-06-19T15:59:06Z","body":"> If people want this, they should use Jersey. Please keep annotation-based\n> routing out of Spark, at all costs. It's the reason I use it.\n>\n+1\n"}}