You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our project we are currently using spring 4.2.X and we recently upgraded to version 2.9.0 of this library. After upgrading we discovered that some of our APIs didn't appear anymore. After some digging, we discovered that an error was thrown and then caught which made troubleshooting difficult.
It's using fields in the PathVariable annotation that was introduced in Spring 4.3.3. Using a lower Spring version triggers a "MethodNotFound" exception. In our case, upgrading Spring is not an option.
As a work around, we have extended the offending class, modified the code. Then we told Spring to use ours as Primary. So we got it currently working.
There's a way for the code to do the same thing but without breaking compatibility
AnnotationUtils is present for Spring since early version and certainly present in all of 4.X versions. That utility class contains a method to get all annotation attributes as a Map. In this case, it's useful to make some annotation changes backwards compatible like in this case.
The text was updated successfully, but these errors were encountered:
In our project we are currently using spring 4.2.X and we recently upgraded to version 2.9.0 of this library. After upgrading we discovered that some of our APIs didn't appear anymore. After some digging, we discovered that an error was thrown and then caught which made troubleshooting difficult.
The issue is in the ParameterRequiredReader class
It's using fields in the PathVariable annotation that was introduced in Spring 4.3.3. Using a lower Spring version triggers a "MethodNotFound" exception. In our case, upgrading Spring is not an option.
As a work around, we have extended the offending class, modified the code. Then we told Spring to use ours as Primary. So we got it currently working.
There's a way for the code to do the same thing but without breaking compatibility
This:
Could become this:
Then this:
To This:
AnnotationUtils is present for Spring since early version and certainly present in all of 4.X versions. That utility class contains a method to get all annotation attributes as a Map. In this case, it's useful to make some annotation changes backwards compatible like in this case.
The text was updated successfully, but these errors were encountered: