func (m *JSONResource) SetRequestModifier(reqmod martian.RequestModifier) {
	m.reqmod = reqmod
}
SetRequestModifier Sets a RequestModifier
package body
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"time"
	"github.com/google/martian/v3"
	"github.com/google/martian/v3/log"
	"github.com/google/martian/v3/parse"
	"github.com/google/martian/v3/verify"
	"github.com/imranismail/bff/jsonpatch"
)
var httpClient = &http.Client{
	Timeout: time.Second * 30,
}
func init() {
	parse.Register("body.JSONResource", jsonResourceFromJSON)
}
type jsonResourceJSON struct {
	Scope          []parse.ModifierType `json:"scope"`
	ResourceURL    string               `json:"url"`
	Method         string               `json:"method"`
	Behavior       string               `json:"behavior"`
	Group          string               `json:"group"`
	AllowedHeaders []string             `json:"allowedHeaders"`
	Modifier       json.RawMessage      `json:"modifier"`
}
type jsonResource struct {
	body     []byte
	behavior string
	group    string
}
type JSONResource struct {
	resourceURL    string
	method         string
	behavior       string
	group          string
	allowedHeaders []string
	reqmod         martian.RequestModifier
	resmod         martian.ResponseModifier
}
func validBehavior(behavior string) bool {
	return behavior == "replace" || behavior == "merge"
}
func NewJSONResource(method string, resourceURL string, behavior string, group string, allowedHeaders []string) (*JSONResource, error) {
	if behavior == "" {
		behavior = "replace"
	}
	if method == "" {
		method = "GET"
	}
	if !validBehavior(behavior) {
		return nil, fmt.Errorf("body.JSONResource.New: invalid behavior %q", behavior)
	}
	log.Debugf("body.JSONResource.New: method(%s) url(%s) behavior(%s)", method, resourceURL, behavior)
	m := &JSONResource{
		resourceURL:    resourceURL,
		method:         method,
		behavior:       behavior,
		group:          group,
		allowedHeaders: allowedHeaders,
	}
	return m, nil
}