func (j *ResponseErrorContext) UnmarshalJSON(input []byte) error {
	fs := fflib.NewFFLexer(input)
	return j.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start)
}
UnmarshalJSON umarshall json - template of ffjson
package api
import (
	"bytes"
	"encoding/json"
	"fmt"
	fflib "github.com/pquerna/ffjson/fflib/v1"
)
func (j *ResponseError) MarshalJSON() ([]byte, error) {
	var buf fflib.Buffer
	if j == nil {
		buf.WriteString("null")
		return buf.Bytes(), nil
	}
	err := j.MarshalJSONBuf(&buf)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
func (j *ResponseError) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if j == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"code":`)
	fflib.FormatBits2(buf, uint64(j.Code), 10, j.Code < 0)
	buf.WriteString(`,"message":`)
	fflib.WriteJsonString(buf, string(j.Message))
	buf.WriteString(`,"data":`)
	{
		err = j.Data.MarshalJSONBuf(buf)
		if err != nil {
			return err
		}
	}
	buf.WriteByte('}')
	return nil
}
const (
	ffjtResponseErrorbase = iota
	ffjtResponseErrornosuchkey
	ffjtResponseErrorCode
	ffjtResponseErrorMessage
	ffjtResponseErrorData
)
var ffjKeyResponseErrorCode = []byte("code")
var ffjKeyResponseErrorMessage = []byte("message")
var ffjKeyResponseErrorData = []byte("data")
func (j *ResponseError) UnmarshalJSON(input []byte) error {
	fs := fflib.NewFFLexer(input)
	return j.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start)
}
func (j *ResponseError) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error {
	var err error
	currentKey := ffjtResponseErrorbase
	_ = currentKey
	tok := fflib.FFTok_init
	wantedTok := fflib.FFTok_init
mainparse:
	for {
		tok = fs.Scan()
		if tok == fflib.FFTok_error {
			goto tokerror
		}
		switch state {
		case fflib.FFParse_map_start:
			if tok != fflib.FFTok_left_bracket {
				wantedTok = fflib.FFTok_left_bracket
				goto wrongtokenerror
			}
			state = fflib.FFParse_want_key
			continue
		case fflib.FFParse_after_value:
			if tok == fflib.FFTok_comma {
				state = fflib.FFParse_want_key
			} else if tok == fflib.FFTok_right_bracket {
				goto done
			} else {
				wantedTok = fflib.FFTok_comma
				goto wrongtokenerror
			}
		case fflib.FFParse_want_key:
			if tok == fflib.FFTok_right_bracket {
				goto done
			}
			if tok != fflib.FFTok_string {
				wantedTok = fflib.FFTok_string
				goto wrongtokenerror
			}
			kn := fs.Output.Bytes()
			if len(kn) <= 0 {
				currentKey = ffjtResponseErrornosuchkey
				state = fflib.FFParse_want_colon
				goto mainparse
			} else {
				switch kn[0] {
				case 'c':
					if bytes.Equal(ffjKeyResponseErrorCode, kn) {
						currentKey = ffjtResponseErrorCode
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'd':
					if bytes.Equal(ffjKeyResponseErrorData, kn) {
						currentKey = ffjtResponseErrorData
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'm':
					if bytes.Equal(ffjKeyResponseErrorMessage, kn) {
						currentKey = ffjtResponseErrorMessage
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				}
				if fflib.SimpleLetterEqualFold(ffjKeyResponseErrorData, kn) {
					currentKey = ffjtResponseErrorData
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyResponseErrorMessage, kn) {
					currentKey = ffjtResponseErrorMessage
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.SimpleLetterEqualFold(ffjKeyResponseErrorCode, kn) {
					currentKey = ffjtResponseErrorCode
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				currentKey = ffjtResponseErrornosuchkey
				state = fflib.FFParse_want_colon
				goto mainparse
			}
		case fflib.FFParse_want_colon:
			if tok != fflib.FFTok_colon {
				wantedTok = fflib.FFTok_colon
				goto wrongtokenerror
			}
			state = fflib.FFParse_want_value
			continue
		case fflib.FFParse_want_value:
			if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null {
				switch currentKey {
				case ffjtResponseErrorCode:
					goto handle_Code
				case ffjtResponseErrorMessage:
					goto handle_Message
				case ffjtResponseErrorData:
					goto handle_Data
				case ffjtResponseErrornosuchkey:
					err = fs.SkipField(tok)
					if err != nil {
						return fs.WrapErr(err)
					}
					state = fflib.FFParse_after_value
					goto mainparse
				}
			} else {
				goto wantedvalue
			}
		}
	}
handle_Code:
	{
		if tok != fflib.FFTok_integer && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64)
			if err != nil {
				return fs.WrapErr(err)
			}
			j.Code = int(tval)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_Message:
	{
		{
			if tok != fflib.FFTok_string && tok != fflib.FFTok_null {
				return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok))
			}
		}
		if tok == fflib.FFTok_null {
		} else {
			outBuf := fs.Output.Bytes()
			j.Message = string(string(outBuf))
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_Data:
	{
		if tok == fflib.FFTok_null {
		} else {
			err = j.Data.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key)
			if err != nil {
				return err
			}
		}
		state = fflib.FFParse_after_value
	}
	state = fflib.FFParse_after_value
	goto mainparse
wantedvalue:
	return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
wrongtokenerror:
	return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String()))
tokerror:
	if fs.BigError != nil {
		return fs.WrapErr(fs.BigError)
	}
	err = fs.Error.ToError()
	if err != nil {
		return fs.WrapErr(err)
	}
	panic("ffjson-generated: unreachable, please report bug.")
done:
	return nil
}
func (j *ResponseErrorContext) MarshalJSON() ([]byte, error) {
	var buf fflib.Buffer
	if j == nil {
		buf.WriteString("null")
		return buf.Bytes(), nil
	}
	err := j.MarshalJSONBuf(&buf)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
func (j *ResponseErrorContext) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if j == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"level":`)
	fflib.WriteJsonString(buf, string(j.Level))
	buf.WriteString(`,"file":`)
	fflib.WriteJsonString(buf, string(j.File))
	buf.WriteString(`,"line":`)
	fflib.FormatBits2(buf, uint64(j.Line), 10, j.Line < 0)
	buf.WriteString(`,"method":`)
	fflib.WriteJsonString(buf, string(j.Method))
	buf.WriteString(`,"hostname":`)
	fflib.WriteJsonString(buf, string(j.Hostname))
	buf.WriteString(`,"thread_name":`)
	fflib.WriteJsonString(buf, string(j.ThreadName))
	buf.WriteString(`,"timestamp":`)
	fflib.WriteJsonString(buf, string(j.Timestamp))
	buf.WriteByte('}')
	return nil
}
const (
	ffjtResponseErrorContextbase = iota
	ffjtResponseErrorContextnosuchkey
	ffjtResponseErrorContextLevel
	ffjtResponseErrorContextFile
	ffjtResponseErrorContextLine
	ffjtResponseErrorContextMethod
	ffjtResponseErrorContextHostname
	ffjtResponseErrorContextThreadName
	ffjtResponseErrorContextTimestamp
)
var ffjKeyResponseErrorContextLevel = []byte("level")
var ffjKeyResponseErrorContextFile = []byte("file")
var ffjKeyResponseErrorContextLine = []byte("line")
var ffjKeyResponseErrorContextMethod = []byte("method")
var ffjKeyResponseErrorContextHostname = []byte("hostname")
var ffjKeyResponseErrorContextThreadName = []byte("thread_name")
var ffjKeyResponseErrorContextTimestamp = []byte("timestamp")