// MarshalJSON marshals this object to JSON for the encoding/json package.
327550
func (e *httpError) MarshalJSON() ([]byte, error) {

	if len(e.data) == 0 {
		return json.Marshal(e.msg)
	}

	innerErr := withFieldsE(nil, "", nil)
	for k, v := range e.data {
		if k != "status" {
			innerErr.data[k] = v
		}
	}

	var innerInnerErr error
	switch len(innerErr.data) {
	case 0:
		innerErr = nil
	case 1:
		var err error
		for _, v := range innerErr.data {
			if tErr, ok := v.(error); ok {
				err = tErr
				break
			}
		}
		if err != nil {
			innerInnerErr = err
		}
	}

	jsonError := struct {
		Message string `json:"message"`
		Status  int    `json:"status"`
		Inner   error  `json:"error,omitempty"`
	}{
		Message: e.msg,
		Status:  e.Status(),
		Inner:   innerErr,
	}

	if innerInnerErr != nil {
		jsonError.Inner = innerInnerErr
	}

	return json.Marshal(jsonError)
}
951072
func MarshalJSON(errobj error) ([]byte, error) {
	errjson, err := newJSON(1, errobj)
	if errjson == nil || err != nil {
		return []byte(""), err
	}
	return json.Marshal(errjson)
}
927857
func (v DSTopicsList) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonCfe4e5f0EncodeGithubComFrancoispqtGojayBenchmarks2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
8958
func (v Storage) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
425078
func (r *Response) MarshalJSON() ([]byte, error) {
	return []byte(r.res), r.err
}
1061427
func (o *Object) MarshalJSON() ([]byte, error) {
	ctx := _builtinJSON_stringifyContext{
		r: o.runtime,
	}
	ex := o.runtime.vm.try(func() {
		if !ctx.do(o) {
			ctx.buf.WriteString("null")
		}
	})
	if ex != nil {
		return nil, ex
	}
	return ctx.buf.Bytes(), nil
}
281339
func (results Results) MarshalJSON() ([]byte, error) {
	for _, result := range results {
		if result.ResultID() == "" {
			result.SetResultID(fmt.Sprintf("%d", &result))
		}

		if err := inferIQR(result); err != nil {
			return nil, err
		}
	}

	return json.Marshal([]Result(results))
}
211797
func (o OvsMap) MarshalJSON() ([]byte, error) {
	var ovsMap, innerMap []interface{}
	ovsMap = append(ovsMap, "map")
	for key, val := range o.GoMap {
		var mapSeg []interface{}
		mapSeg = append(mapSeg, key)
		mapSeg = append(mapSeg, val)
		innerMap = append(innerMap, mapSeg)
	}
	ovsMap = append(ovsMap, innerMap)
	return json.Marshal(ovsMap)
}
323622
func (t String) MarshalJSON() ([]byte, error) {
	return json.Marshal(map[string]interface{}{
		"type": t.typeMarker(),
	})
}
545903
func (r Response) MarshalJSON() ([]byte, error) {
	return marshalJSON(_Response(r), r.Extensions)
}
85315
func (t *Array) MarshalJSON() ([]byte, error) {
	repr := map[string]interface{}{
		"type": t.typeMarker(),
	}
	if len(t.static) != 0 {
		repr["static"] = t.static
	}
	if t.dynamic != nil {
		repr["dynamic"] = t.dynamic
	}
	return json.Marshal(repr)
}
601722
func (v App) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson633f8c25EncodeGithubComCloudfoundryCommunityFirehoseToSyslogCaching(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
90283
func (t *Function) MarshalJSON() ([]byte, error) {
	repr := map[string]interface{}{
		"type": t.typeMarker(),
	}
	if len(t.args) > 0 {
		repr["args"] = t.args
	}
	if t.result != nil {
		repr["result"] = t.result
	}
	return json.Marshal(repr)
}
349131
func (es Errors) MarshalJSON() ([]byte, error) {
	errs := map[string]interface{}{}
	for key, err := range es {
		if ms, ok := err.(json.Marshaler); ok {
			errs[key] = ms
		} else {
			errs[key] = err.Error()
		}
	}
	return json.Marshal(errs)
}
307783
func (r *Repository) MarshalJSON() ([]byte, error) {
	data := map[string]interface{}{
		"name":    r.Name,
		"public":  r.IsPublic,
		"ssh_url": r.ReadWriteURL(),
		"git_url": r.ReadOnlyURL(),
	}
	return json.Marshal(&data)
}
454827
func (v Opened) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents5(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
132157
func (s *RecursiveSchema) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf(`"%s"`, s.Actual.GetName())), nil
}