func JSONtoYAMLBytes(jsonBytes []byte) ([]byte, error) {
	obj, err := JSONtoYAMLMapSlice(jsonBytes)
	if err != nil {
		return nil, err
	}
	return yaml.Marshal(obj)
}
JSONtoYAMLBytes converts json data to yaml output while preserving order of object fields.
package safeyaml
import (
	"bytes"
	"encoding/json"
	"fmt"
	"gopkg.in/yaml.v2"
)
func JSONtoYAMLMapSlice(jsonBytes []byte) (interface{}, error) {
	dec := json.NewDecoder(bytes.NewReader(jsonBytes))
	dec.UseNumber()
	val, err := tokenizerToYAML(dec)
	if err != nil {
		return val, err
	}
	if dec.More() {
		return nil, fmt.Errorf("invalid input after top-level JSON value")
	}
	return val, nil
}