You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: jsonrpccodec.go
    path of file: ./repos/chainlink/core/services/gateway/api
    
    the code of the file until where you have to start completion: package api

import (
	"encoding/json"
	"errors"
	"fmt"
)

// Wrapping/unwrapping Message objects into JSON RPC ones folllowing https://www.jsonrpc.org/specificatio
    
func (*JsonRPCCodec) DecodeResponse(msgBytes []byte) (*Message, error) {
	var response JsonRPCResponse
	err := json.Unmarshal(msgBytes, &response)
	if err != nil {
		return nil, err
	}
	if response.Error != nil {
		return nil, fmt.Errorf("received non-empty error field: %v", response.Error)
	}
	if response.Result != nil {
		response.Result.Body.MessageId = response.Id
	}
	return response.Result, nil
}