mirror of
https://github.com/zaaarf/route-cartographer.git
synced 2024-12-04 16:14:53 +01:00
fix: annotation fields are actually methods
This commit is contained in:
parent
47b45e2e42
commit
b7ea0fdd81
2 changed files with 3 additions and 1 deletions
|
@ -56,6 +56,8 @@ public class Route {
|
|||
* @param consumes the {@link MediaType} consumed by the endpoint, may be null
|
||||
* @param produces the {@link MediaType} produced by the endpoint, may be null
|
||||
* @param deprecated whether the endpoint is deprecated
|
||||
* @param returnType the DTO for the response type, may be null
|
||||
* @param inputType the DTO for the request type, may be null
|
||||
* @param params {@link Param}s of the endpoint, may be null
|
||||
*/
|
||||
public Route(String path, RequestMethod[] methods, MediaType consumes, MediaType produces,
|
||||
|
|
|
@ -288,7 +288,7 @@ public class RouteCompass extends AbstractProcessor {
|
|||
|
||||
T result = null;
|
||||
for(String fieldName : fieldNames) {
|
||||
result = (T) annClass.getField(fieldName).get(element.getAnnotation(annClass));
|
||||
result = (T) annClass.getMethod(fieldName).invoke(element.getAnnotation(annClass));
|
||||
if(result != null) return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue