func GetValidationError(err error) error {
	if vErr, ok := err.(RequestValidationError); ok {
		if causeErr, ok := vErr.Cause().(RequestValidationError); ok {
			return ValidationError{
				field:  util.CamelToSnake(causeErr.Field()),
				reason: causeErr.Reason(),
				key:    causeErr.Key(),
				cause:  causeErr.Cause(),
			}
		}
	}
	return err
}
GetValidationError function returns a validation error from an error.
package validationerrors
import (
	"context"
	"fmt"
	"github.com/infobloxopen/atlas-app-toolkit/util"
	"google.golang.org/grpc"
)
type validator interface {
	Validate() error
}
func UnaryServerInterceptor() grpc.UnaryServerInterceptor {
	return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
		if v, ok := req.(validator); ok {
			if err := v.Validate(); err != nil {
				return nil, GetValidationError(err)
			}
		}
		return handler(ctx, req)
	}
}