@@ -1116,17 +1116,21 @@ protected Type findJsonValueType(final BeanDescription beanDesc) {
1116
1116
1117
1117
// use recursion to check for method findJsonValueAccessor existence (Jackson 2.9+)
1118
1118
// if not found use previous deprecated method which could lead to inaccurate result
1119
- AnnotatedMember jsonValueMember = invokeMethod (beanDesc , "findJsonValueAccessor" );
1120
- if (jsonValueMember != null ) {
1121
- return jsonValueMember .getType ();
1122
- } else {
1119
+ try {
1120
+ AnnotatedMember jsonValueMember = invokeMethod (beanDesc , "findJsonValueAccessor" );
1121
+ if (jsonValueMember != null ) {
1122
+ return jsonValueMember .getType ();
1123
+ }
1124
+ } catch (Exception e ) {
1123
1125
LOGGER .warn ("jackson BeanDescription.findJsonValueAccessor not found, this could lead to inaccurate result, please update jackson to 2.9+" );
1124
1126
}
1125
1127
1126
- jsonValueMember = invokeMethod (beanDesc , "findJsonValueMethod" );
1127
- if (jsonValueMember != null ) {
1128
- return jsonValueMember .getType ();
1129
- } else {
1128
+ try {
1129
+ AnnotatedMember jsonValueMember = invokeMethod (beanDesc , "findJsonValueMethod" );
1130
+ if (jsonValueMember != null ) {
1131
+ return jsonValueMember .getType ();
1132
+ }
1133
+ } catch (Exception e ) {
1130
1134
LOGGER .error ("Neither 'findJsonValueMethod' nor 'findJsonValueAccessor' found in jackson BeanDescription. Please verify your Jackson version." );
1131
1135
}
1132
1136
return null ;
@@ -3057,13 +3061,9 @@ protected boolean isNumberSchema(Schema schema){
3057
3061
return "number" .equals (schema .getType ()) || (schema .getTypes () != null && schema .getTypes ().contains ("number" )) || "integer" .equals (schema .getType ()) || (schema .getTypes () != null && schema .getTypes ().contains ("integer" ));
3058
3062
}
3059
3063
3060
- private AnnotatedMember invokeMethod (final BeanDescription beanDesc , String methodName ) {
3061
- try {
3062
- Method m = BeanDescription .class .getMethod (methodName );
3063
- return (AnnotatedMember ) m .invoke (beanDesc );
3064
- } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e ) {
3065
- return null ;
3066
- }
3064
+ private AnnotatedMember invokeMethod (final BeanDescription beanDesc , String methodName ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException {
3065
+ Method m = BeanDescription .class .getMethod (methodName );
3066
+ return (AnnotatedMember ) m .invoke (beanDesc );
3067
3067
}
3068
3068
3069
3069
protected Schema buildRefSchemaIfObject (Schema schema , ModelConverterContext context ) {
0 commit comments