retrofit-spring-boot-starter icon indicating copy to clipboard operation
retrofit-spring-boot-starter copied to clipboard

拦截器兼容性不行

Open look2J opened this issue 1 year ago • 2 comments

com.github.lianjiatech retrofit-spring-boot-starter 3.0.2 该版本的拦截器 Method method = ((Invocation)Objects.requireNonNull((Invocation)request.tag(Invocation.class))).method(); 要求必须存在Invocation、Method ,兼容性不够好,旧项目有些事直接使用httpClient的,引入retrofit-spring-boot-starter之后,自动注入此拦截器并每次都会拦截,然后由于没有Invocation、Method所以报错了,我理解所有的拦截器都不要强制性要求存在Invocation、Method 这些,没有,那就当做普通的http请求来调用

look2J avatar Nov 13 '23 06:11 look2J

目前相关拦截器逻辑是强依赖Invocation、Method的,不过确实可以优化成没有的时候不抛错。

chentianming11 avatar Dec 17 '23 12:12 chentianming11

新版本已支持

chentianming11 avatar Dec 17 '23 13:12 chentianming11