func verifierFromJSON(b []byte) (*parse.Result, error) {
	msg := &verifierJSON{}
	if err := json.Unmarshal(b, msg); err != nil {
		return nil, err
	}
	v, err := NewVerifier(msg.Message)
	if err != nil {
		return nil, err
	}
	return parse.NewResult(v, msg.Scope)
}
verifierFromJSON builds a failure.Verifier from JSON

Example JSON:
{
"failure.Verifier": {
"scope": ["request", "response"],
"message": "Request passed a filter it should not have"
}
}
package failure
import (
	"encoding/json"
	"fmt"
	"net/http"
	"github.com/google/martian/v3"
	"github.com/google/martian/v3/parse"
	"github.com/google/martian/v3/verify"
)
func init() {
	parse.Register("failure.Verifier", verifierFromJSON)
}
type verifier struct {
	message string
	merr    *martian.MultiError
}
type verifierJSON struct {
	Message string               `json:"message"`
	Scope   []parse.ModifierType `json:"scope"`
}
func NewVerifier(message string) (verify.RequestVerifier, error) {
	return &verifier{
		message: message,
		merr:    martian.NewMultiError(),
	}, nil
}
func (v *verifier) ModifyRequest(req *http.Request) error {
	err := fmt.Errorf("request(%v) verification error: %s", req.URL, v.message)
	v.merr.Add(err)
	return nil
}
func (v *verifier) VerifyRequests() error {
	if v.merr.Empty() {
		return nil
	}
	return v.merr
}
func (v *verifier) ResetRequestVerifications() {
	v.merr = martian.NewMultiError()
}