fix: annotation fields are actually methods

This commit is contained in:
zaaarf 2024-01-23 11:20:29 +01:00
parent 47b45e2e42
commit b7ea0fdd81
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B
2 changed files with 3 additions and 1 deletions

View file

@ -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,

View file

@ -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;
}