Feign PathVariable annotation was empty on param 0.


使用Feign的时候,如果参数中带有@PathVariable形式的参数,则要用value=""标明对应的参数,否则会抛出IllegalStateException异常。

如下(会报错)

@PutMapping("/disuseable/{sn}")
ApiResponse disUseAble(@PathVariable String sn);

正确的写法:

@PutMapping("/disuseable/{sn}")
ApiResponse disUseAble(@PathVariable(value="sn") String sn); 

相关阅读 >>

feign PathVariable annotation was empty on param 0.

更多相关阅读请进入《PathVariable》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...