// unmarshalJSONC unmarshals the JSON using a fault-tolerant parser that allows comments
// and trailing commas. If any unrecoverable faults are found, an error is returned.
166055
func unmarshalJSONC(text string, v interface{}) error {
	data, errs := jsonx.Parse(text, jsonx.ParseOptions{Comments: true, TrailingCommas: true})
	if len(errs) > 0 {
		return fmt.Errorf("failed to parse JSON: %v", errs)
	}
	return json.Unmarshal(data, v)
}
245654
func (s *WebAccelCertResponseBody) UnmarshalJSON(data []byte) error {
	targetData := strings.Replace(strings.Replace(string(data), " ", "", -1), "\n", "", -1)
	if targetData == `[]` {
		return nil
	}

	tmp := &struct {
		Current *WebAccelCert   `json:",omitempty"`
		Old     []*WebAccelCert `json:",omitempty"`
	}{}
	if err := json.Unmarshal(data, &tmp); err != nil {
		return err
	}

	s.Current = tmp.Current
	s.Old = tmp.Old
	return nil
}
1252374
func (s *SerializableError) UnmarshalJSON(text []byte) (err error) {
	var x struct{ Name string }
	err = json.Unmarshal(text, &x)
	if err != nil {
		return
	}
	var theError error
	switch x.Name {
	case "ErrValidation":
		var e struct{ Error ErrValidation }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadHierarchy":
		var e struct{ Error ErrBadHierarchy }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadRoot":
		var e struct{ Error ErrBadRoot }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadTargets":
		var e struct{ Error ErrBadTargets }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadSnapshot":
		var e struct{ Error ErrBadSnapshot }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	default:
		err = fmt.Errorf("do not know how to unmarshal %s", x.Name)
		return
	}
	if err != nil {
		return
	}
	s.Name = x.Name
	s.Error = theError
	return nil
}
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
}
231896
func (v *eventReceivedMessageFromTarget) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonC5ff9ce6DecodeGithubComChromedpChromedp(&r, v)
	return r.Error()
}
124438
func (s *ReleaseSpec) UnmarshalJSON(b []byte) error {
	type T ReleaseSpec
	t := (*T)(s)
	if err := json.Unmarshal(b, t); err != nil {
		return err
	}

	switch t.Type {
	case "":
		r := &update.ReleaseImageSpec{}
		if err := json.Unmarshal(b, r); err != nil {
			return err
		}
		s.Type = ReleaseImageSpecType
		s.ReleaseImageSpec = r

	case ReleaseImageSpecType, ReleaseContainersSpecType:
		// all good
	default:
		return errors.New("unknown ReleaseSpec type")
	}
	return nil
}
86845
func (u *UUID) UnmarshalJSON(b []byte) error {
	var s string
	if err := json.Unmarshal(b, &s); err != nil {
		return err
	}

	new, err := ParseUUID(s)
	if err == nil {
		u.UUID = new.UUID
	}
	return err
}
212553
func (s *WebAccelCertResponse) UnmarshalJSON(data []byte) error {
	tmp := &struct {
		Certificate *WebAccelCertResponseBody `json:",omitempty"`
		ResultFlagValue
	}{}
	if err := json.Unmarshal(data, &tmp); err != nil {
		return err
	}

	if tmp.Certificate.Current != nil || len(tmp.Certificate.Old) > 0 {
		s.Certificate = tmp.Certificate
	}
	s.ResultFlagValue = tmp.ResultFlagValue
	return nil
}
677034
func (v *Annotation) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat3(&r, v)
	return r.Error()
}
1160941
func (s *UUID) UnmarshalJSON(data []byte) error {
	var ss []string
	if err := json.Unmarshal(data, &ss); err != nil {
		return err
	}
	us, err := strSliceToUUIDSlice(ss)
	if err != nil {
		return errors.WithStack(err)
	}
	*s = us
	return nil
}
958241
func (v *bulkUpdateRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson1ed00e60DecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
334205
func (s *String) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		s.Valid = false
		return nil
	}
	if data == nil {
		s.Chars, s.Valid = "", false
		return nil
	}

	s.Valid = true

	return json.Unmarshal(data, &s.Chars)
}
1014834
func (v *bulkIndexRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson9de0fcbfDecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
850813
func (jb *JSONBuffer) UnmarshalJSON(data []byte) (err error) {
	var str string
	err = json.Unmarshal(data, &str)
	if err != nil {
		return err
	}
	*jb, err = base64URLDecode(str)
	return
}
1162891
func (u *Uint64) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		u.Valid = false
		return nil
	}
	if err := json.Unmarshal(data, &u.Uint64); err != nil {
		return err
	}
	u.Valid = true
	return nil
}
598216
func (e MessagePathEnumNestedPathEnum) UnmarshalJSON(b []byte) error {
	return unmarshalJSONEnum(b, pbpathenum.MessagePathEnum_NestedPathEnum_value)
}
455628
func (u *UUID) UnmarshalJSON(b []byte) error {
	var j string
	err := json.Unmarshal(b, &j)
	if err == nil {
		v := ParseUUID(string(j))
		if v != nil {
			*u = v
		} else {
			err = fmt.Errorf("Bad UUID: %v", string(j))
		}
	}
	return err
}