WebRequest parameter should by ignored by Feign SpringMvcContract
See original GitHub issueCurrently following interface method:
ResponseEntity<ModelSO> getSubscriptionInformation(
@RequestBody @ApiParam(name = "request", value = "The body of the request", required = true)
ModelSO model, // body 1
WebRequest webRequest); // body2 ?
can’t be used as Feign Client:
java.lang.IllegalStateException: Method has too many Body parameters: public abstract org.springframework.http.ResponseEntity com.daimler.daivb.vts.snap.SubscriptionInformationSI.getSubscriptionInformation(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.daimler.daivb.vts.snap.SubscriptionRequestSO,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,org.springframework.web.context.request.WebRequest)
at feign.Util.checkState(Util.java:128)
at feign.Contract$BaseContract.parseAndValidateMetadata(Contract.java:114)
at org.springframework.cloud.netflix.feign.support.SpringMvcContract.parseAndValidateMetadata(SpringMvcContract.java:131)
at feign.Contract$BaseContract.parseAndValidatateMetadata(Contract.java:64)
at feign.ReflectiveFeign$ParseHandlersByName.apply(ReflectiveFeign.java:146)
at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:53)
at feign.Feign$Builder.target(Feign.java:209)
at feign.Feign$Builder.target(Feign.java:205)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Spring Cloud OpenFeign Failed to Create Dynamic Query ...
Spring cloud openFeign can't create dynamic query parameters. It throws below exception because SpringMvcContract tries to find the ...
Read more >Introduction to Spring Cloud OpenFeign - Baeldung
In this tutorial, we're going to describe Spring Cloud OpenFeign — a declarative REST client for Spring Boot apps.
Read more >Spring Cloud OpenFeign
Feign is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it....
Read more >Passing headers with Spring Cloud Feign - Arnold Galovics
Fortunately, you can use Spring MVC annotations to pass the header to the translator service as a simple parameter. Let's see in practice, ......
Read more >Feign - Bloglovin'
Should Feign interface has @PathVariable and @RequestParam annotations with stated ... processAnnotationsOnParameter(SpringMvcContract.java:280) at feign.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The same problem with
where Error is org.springframework.validation.Errors
I can’t use Feign with spring validation in controller, because I have error Method has too many Body parameters
@jvstepanova84 Have you tried using the workaround provided by @tjuchniewicz above?