// ByUnmarshallingJSON returns a RespondDecorator that decodes a JSON document returned in the
// response Body into the value pointed to by v.
430139
func ByUnmarshallingJSON(v interface{}) RespondDecorator {
	return func(r Responder) Responder {
		return ResponderFunc(func(resp *http.Response) error {
			err := r.Respond(resp)
			if err == nil {
				b, errInner := ioutil.ReadAll(resp.Body)
				// Some responses might include a BOM, remove for successful unmarshalling
				b = bytes.TrimPrefix(b, []byte("\xef\xbb\xbf"))
				if errInner != nil {
					err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner)
				} else if len(strings.Trim(string(b), " ")) > 0 {
					errInner = json.Unmarshal(b, v)
					if errInner != nil {
						err = fmt.Errorf("Error occurred unmarshalling JSON - Error = '%v' JSON = '%s'", errInner, string(b))
					}
				}
			}
			return err
		})
	}
}
785566
func (node *TableIdent) UnmarshalJSON(b []byte) error {
	var result string
	err := json.Unmarshal(b, &result)
	if err != nil {
		return err
	}
	node.v = result
	return nil
}
695262
func (vd *VolumeSnapshotList) UnmarshalJSON(data []byte) error {
	tmp := VolumeSnapshotListCopy{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	tmp2 := VolumeSnapshotList(tmp)
	*vd = tmp2
	return nil
}
552590
func (r *Response) WriteHeaderAndJson(status int, value interface{}, contentType string) error {
	return writeJSON(r, status, contentType, value)
}
598216
func (e MessagePathEnumNestedPathEnum) UnmarshalJSON(b []byte) error {
	return unmarshalJSONEnum(b, pbpathenum.MessagePathEnum_NestedPathEnum_value)
}
1014834
func (v *bulkIndexRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson9de0fcbfDecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
579943
func (b *Uint64) UnmarshalJSON(input []byte) error {
	if !isString(input) {
		return errNonString(uint64T)
	}
	return wrapTypeError(b.UnmarshalText(input[1:len(input)-1]), uint64T)
}
1218327
func (intstr *IntOrString) UnmarshalJSON(value []byte) error {
	if value[0] == '"' {
		intstr.Type = String
		return json.Unmarshal(value, &intstr.StrVal)
	}
	intstr.Type = Int
	return json.Unmarshal(value, &intstr.IntVal)
}
1345070
func (v *Value) UnmarshalJSON(b []byte) error {
	if len(b) == 0 {
		return fmt.Errorf("error unmarshaling empty bytes")
	}
	var val interface{}
	var err error
	switch b[0] {
	case '-':
		var ival int64
		err = json.Unmarshal(b, &ival)
		val = ival
	case '"':
		var bval []byte
		err = json.Unmarshal(b, &bval)
		val = bval
	case 'n': // null
		err = json.Unmarshal(b, &val)
	default:
		var uval uint64
		err = json.Unmarshal(b, &uval)
		val = uval
	}
	if err != nil {
		return err
	}
	*v, err = InterfaceToValue(val)
	return err
}
1080706
func (response *RPCResponse) UnmarshalJSON(data []byte) error {
	unsafeResp := &struct {
		JSONRPC string          `json:"jsonrpc"`
		ID      interface{}     `json:"id"`
		Result  json.RawMessage `json:"result,omitempty"`
		Error   *RPCError       `json:"error,omitempty"`
	}{}
	err := json.Unmarshal(data, &unsafeResp)
	if err != nil {
		return err
	}
	response.JSONRPC = unsafeResp.JSONRPC
	response.Error = unsafeResp.Error
	response.Result = unsafeResp.Result
	if unsafeResp.ID == nil {
		return nil
	}
	id, err := idFromInterface(unsafeResp.ID)
	if err != nil {
		return err
	}
	response.ID = id
	return nil
}
159097
func (self *EnumElementDef) UnmarshalJSON(b []byte) error {
	var m rawEnumElementDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := EnumElementDef(m)
		*self = o
		err = self.Validate()
	}
	return err
}
948159
func (r *Raw) UnmarshalJSON(data []byte) error {
	if r == nil {
		return errors.New("Raw: UnmarshalJSON on nil pointer")
	}
	*r = append((*r)[0:0], data...)
	return nil
}
594478
func (self *EnumTypeDef) UnmarshalJSON(b []byte) error {
	var m rawEnumTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := EnumTypeDef(m)
		*self = *((&o).Init())
		err = self.Validate()
	}
	return err
}
1185940
func (r *Response) WriteJson(value interface{}, contentType string) error {
	return writeJSON(r, http.StatusOK, contentType, value)
}
824684
func (bj *BinaryJSON) UnmarshalJSON(data []byte) error {
	var decoder = json.NewDecoder(bytes.NewReader(data))
	decoder.UseNumber()
	var in interface{}
	err := decoder.Decode(&in)
	if err != nil {
		return errors.Trace(err)
	}
	buf := make([]byte, 0, len(data))
	var typeCode TypeCode
	typeCode, buf, err = appendBinary(buf, in)
	if err != nil {
		return errors.Trace(err)
	}
	bj.TypeCode = typeCode
	bj.Value = buf
	return nil
}
1364342
func (pTypeDef *MapArrayTest) UnmarshalJSON(b []byte) error {
	var r rawMapArrayTest
	err := json.Unmarshal(b, &r)
	if err == nil {
		o := MapArrayTest(r)
		*pTypeDef = *((&o).Init())
		err = pTypeDef.Validate()
	}
	return err
}
1016238
func (self *BytesTypeDef) UnmarshalJSON(b []byte) error {
	var m rawBytesTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := BytesTypeDef(m)
		*self = o
		err = self.Validate()
	}
	return err
}