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