Open kaszuster opened 8 months ago
When using OpenFeign in the following way (no name attribute specified):
@RequestLine("GET /getSomething?id={id}") String getSomething(@Param String id);
You may encounter the following exception:
... annotation was empty on param 0
This happens because @Param long catalogId is compiled as @Param long arg0. OpenFeign will then fail to read the parameter name via reflection.
@Param long catalogId
@Param long arg0
To fix this, you need to pass the parameters flag to the Java compiler:
parameters
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <parameters>true</parameters> </configuration> </plugin>
After hours of research and debugging I have found this solution. Just now I found a little hint in your documentation: (if the code was compiled with -parameters flag). I would like to see that more visible or even in the exception..
(if the code was compiled with -parameters flag)
Thanks for finding this. Open to pull requests to update our documentation.
When using OpenFeign in the following way (no name attribute specified):
You may encounter the following exception:
... annotation was empty on param 0
This happens because
@Param long catalogId
is compiled as@Param long arg0
. OpenFeign will then fail to read the parameter name via reflection.To fix this, you need to pass the
parameters
flag to the Java compiler:After hours of research and debugging I have found this solution. Just now I found a little hint in your documentation:
(if the code was compiled with -parameters flag)
. I would like to see that more visible or even in the exception..