{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/1768","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/1768/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/1768/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/1768/events","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/issues/1768","id":213464546,"number":1768,"title":"Enhance Feign Clients to Support New String REST Annotations, like @GetMapping","user":{"login":"pluttrell","id":4094051,"avatar_url":"https://avatars0.githubusercontent.com/u/4094051?v=3","gravatar_id":"","url":"https://api.github.com/users/pluttrell","html_url":"https://github.com/pluttrell","followers_url":"https://api.github.com/users/pluttrell/followers","following_url":"https://api.github.com/users/pluttrell/following{/other_user}","gists_url":"https://api.github.com/users/pluttrell/gists{/gist_id}","starred_url":"https://api.github.com/users/pluttrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pluttrell/subscriptions","organizations_url":"https://api.github.com/users/pluttrell/orgs","repos_url":"https://api.github.com/users/pluttrell/repos","events_url":"https://api.github.com/users/pluttrell/events{/privacy}","received_events_url":"https://api.github.com/users/pluttrell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-10T22:06:09Z","updated_at":"2017-03-10T22:14:29Z","closed_at":"2017-03-10T22:14:29Z","body":"This example client interface which has a more modern Spring REST annotation:\r\n\r\n```\r\nimport org.springframework.cloud.netflix.feign.FeignClient;\r\nimport org.springframework.hateoas.Resource;\r\nimport org.springframework.web.bind.annotation.PostMapping;\r\n\r\n@FeignClient(\"...\")\r\npublic interface CarsFeignClient {\r\n  @PostMapping(\"/cars\")\r\n  Resource<Car> createCar(Car car);\r\n}\r\n```\r\n\r\nCurrently causes this exception:\r\n\r\n```\r\njava.lang.IllegalStateException: Method createCar not annotated with HTTP method type (ex. GET, POST)\r\n\tat feign.Util.checkState(Util.java:128) ~[feign-core-9.3.1.jar:na]\r\n\tat feign.Contract$BaseContract.parseAndValidateMetadata(Contract.java:97) ~[feign-core-9.3.1.jar:na]\r\n\tat org.springframework.cloud.netflix.feign.support.SpringMvcContract.parseAndValidateMetadata(SpringMvcContract.java:133) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE]\r\n\tat feign.Contract$BaseContract.parseAndValidatateMetadata(Contract.java:64) ~[feign-core-9.3.1.jar:na]\r\n\tat feign.hystrix.HystrixDelegatingContract.parseAndValidatateMetadata(HystrixDelegatingContract.java:34) ~[feign-hystrix-9.3.1.jar:na]\r\n\tat feign.ReflectiveFeign$ParseHandlersByName.apply(ReflectiveFeign.java:146) ~[feign-core-9.3.1.jar:na]\r\n\tat feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:53) ~[feign-core-9.3.1.jar:na]\r\n\tat feign.Feign$Builder.target(Feign.java:209) ~[feign-core-9.3.1.jar:na]\r\n\tat org.springframework.cloud.netflix.feign.HystrixTargeter.target(HystrixTargeter.java:48) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE]\r\n\tat org.springframework.cloud.netflix.feign.FeignClientFactoryBean.loadBalance(FeignClientFactoryBean.java:146) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE]\r\n\tat org.springframework.cloud.netflix.feign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:167) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE]\r\n\tat org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]\r\n\t... 30 common frames omitted\r\n\r\n```\r\n\r\nWhereas using the older REST Annotations, such as the following works fine:\r\n\r\n```\r\nimport org.springframework.cloud.netflix.feign.FeignClient;\r\nimport org.springframework.hateoas.Resource;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\n\r\n@FeignClient(\"...\")\r\npublic interface CarsFeignClient {\r\n  @RequestMapping(method = RequestMethod.POST, path = \"/cars\")\r\n  Resource<Car> createCar(Car car);\r\n}\r\n```"}}
{"actor":{"display_login":"spencergibb"}}