我正在使用swagger-codegen为我的Feign客户端生成界面。
然而,swagger-codegen生成以下方法:
Optional<ObjectMapper> getObjectMapper();
Optional<HttpServletRequest> getRequest();当我运行我的应用程序时,我收到这个excpetion:
FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Method getRequest not annotated with HTTP method type (ex. GET, POST)我想在我的FeignConfig中添加一些东西来告诉我忽略接口中的getObjectMapper(),getRequest()!
这是可能的吗?
发布于 2021-01-11 22:46:19
为了解决这个问题,我只为getObjectMapper()、getRequest()添加了默认值。
@Override
default Optional<ObjectMapper> getObjectMapper() {
return Optional.empty();
}
@Override
default Optional<HttpServletRequest> getRequest() {
return Optional.empty();
}https://stackoverflow.com/questions/61194626
复制相似问题