@@ -82,17 +82,19 @@ public Operation customize(Operation operation, HandlerMethod handlerMethod) {
82
82
if (operationFiled != null ) {
83
83
try {
84
84
actuatorOperation = operationFiled .get (handlerMethod .getBean ());
85
- operationFiled = FieldUtils .getDeclaredField (actuatorOperation .getClass (), OPERATION , true );
86
- AbstractDiscoveredOperation discoveredOperation = (AbstractDiscoveredOperation ) operationFiled .get (actuatorOperation );
87
- OperationMethod operationMethod = discoveredOperation .getOperationMethod ();
88
- if (OperationType .WRITE .equals (operationMethod .getOperationType ())) {
89
- for (OperationParameter operationParameter : operationMethod .getParameters ()) {
90
- Field parameterField = FieldUtils .getDeclaredField (operationParameter .getClass (), PARAMETER , true );
91
- Parameter parameter = (Parameter ) parameterField .get (operationParameter );
92
- Schema <?> schema = AnnotationsUtils .resolveSchemaFromType (parameter .getType (), null , null );
93
- if (parameter .getAnnotation (Selector .class ) == null ) {
94
- operation .setRequestBody (new RequestBody ()
95
- .content (new Content ().addMediaType (org .springframework .http .MediaType .APPLICATION_JSON_VALUE , new MediaType ().schema (schema ))));
85
+ Field actuatorOperationFiled = FieldUtils .getDeclaredField (actuatorOperation .getClass (), OPERATION , true );
86
+ if (actuatorOperationFiled !=null ){
87
+ AbstractDiscoveredOperation discoveredOperation = (AbstractDiscoveredOperation ) actuatorOperationFiled .get (actuatorOperation );
88
+ OperationMethod operationMethod = discoveredOperation .getOperationMethod ();
89
+ if (OperationType .WRITE .equals (operationMethod .getOperationType ())) {
90
+ for (OperationParameter operationParameter : operationMethod .getParameters ()) {
91
+ Field parameterField = FieldUtils .getDeclaredField (operationParameter .getClass (), PARAMETER , true );
92
+ Parameter parameter = (Parameter ) parameterField .get (operationParameter );
93
+ Schema <?> schema = AnnotationsUtils .resolveSchemaFromType (parameter .getType (), null , null );
94
+ if (parameter .getAnnotation (Selector .class ) == null ) {
95
+ operation .setRequestBody (new RequestBody ()
96
+ .content (new Content ().addMediaType (org .springframework .http .MediaType .APPLICATION_JSON_VALUE , new MediaType ().schema (schema ))));
97
+ }
96
98
}
97
99
}
98
100
}
0 commit comments