@@ -0,0 +1,1857 @@
+package org.mifosng.platform.api.errorhandling;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport javax.ws.rs.core.Response;%0Aimport javax.ws.rs.core.Response.Status;%0Aimport javax.ws.rs.ext.ExceptionMapper;%0Aimport javax.ws.rs.ext.Provider;%0A%0Aimport org.codehaus.jackson.map.exc.UnrecognizedPropertyException;%0Aimport org.mifosng.data.ApiGlobalErrorResponse;%0Aimport org.mifosng.data.ApiParameterError;%0Aimport org.springframework.context.annotation.Scope;%0Aimport org.springframework.stereotype.Component;%0A%0A/**%0A * An %7B@link ExceptionMapper%7D to map %7B@link UnrecognizedPropertyException%7D thrown by platform into a HTTP API friendly format.%0A * %0A * The %7B@link UnrecognizedPropertyException%7D is typically thrown when a parameter is passed during and post or put that is not expected.%0A */%0A@Provider%0A@Component%0A@Scope(%22singleton%22)%0Apublic class UnrecognizedPropertyExceptionMapper implements ExceptionMapper%3CUnrecognizedPropertyException%3E %7B%0A%0A%09@Override%0A%09public Response toResponse(UnrecognizedPropertyException exception) %7B%0A%09%09%0A%09%09String parameterName = exception.getUnrecognizedPropertyName();%0A%09%09%0A%09%09StringBuilder validationErrorCode = new StringBuilder(%22error.msg.parameter.%22).append(parameterName).append(%22.unsupported%22);%0A%09%09StringBuilder defaultEnglishMessage = new StringBuilder(%22The parameter %22).append(parameterName).append(%22 is not supported.%22);%0A%09%09ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(), defaultEnglishMessage.toString(), parameterName);%0A%09%09%0A%09%09List%3CApiParameterError%3E errors = new ArrayList%3CApiParameterError%3E();%09%09%0A%09%09errors.add(error);%0A%09%09%0A%09%09ApiGlobalErrorResponse invalidParameterError = ApiGlobalErrorResponse.badClientRequest(%0A%09%09%09%09%22validation.msg.validation.errors.exist%22,%0A%09%09%09%09%22Validation errors exist.%22, errors);%0A%09%09%0A%09%09return Response.status(Status.BAD_REQUEST).entity(invalidParameterError).build();%0A%09%7D%0A%7D

add general support for unsupported parameters in modifying requests.