func (enum *KeyPathTypeEnum) UnmarshalJSON(bytes []byte) error {
	var err error
	var val string
	err = json.Unmarshal(bytes, &val)
	if nil != err {
		return err
	}
	for k, v := range _keyPathTypeEnums {
		if v == val {
			*enum = k
			return nil
		}
	}
	return fmt.Errorf("%s is not a valid type value", bytes)
}
/*
UnmarshalJSON implements json.Unmarshaler
package db
import (
	"encoding/json"
	"fmt"
)
type keyPathTypeEnum struct {
	Null   KeyPathTypeEnum
	String KeyPathTypeEnum
	Array  KeyPathTypeEnum
}
var KeyPathType = keyPathTypeEnum{
	Null:   keyPathTypeNull,
	String: keyPathTypeString,
	Array:  keyPathTypeArray,
}
type KeyPathTypeEnum int
func (enum KeyPathTypeEnum) String() string {
	return _keyPathTypeEnums[enum]
}
func (enum KeyPathTypeEnum) MarshalJSON() ([]byte, error) {
	return json.Marshal(enum.String())
}