func NewSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.ObjectTyper, pretty bool) *Serializer {
	return &Serializer{
		meta:    meta,
		creater: creater,
		typer:   typer,
		yaml:    false,
		pretty:  pretty,
	}
}
NewSerializer creates a JSON serializer that handles encoding versioned objects into the proper JSON form. If typer
is not nil, the object has the group, version, and kind fields set.
package json
import (
	"encoding/json"
	"io"
	"strconv"
	"unsafe"
	"github.com/ghodss/yaml"
	jsoniter "github.com/json-iterator/go"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apimachinery/pkg/runtime/serializer/recognizer"
	"k8s.io/apimachinery/pkg/util/framer"
	utilyaml "k8s.io/apimachinery/pkg/util/yaml"
)