func (r Ref) MarshalJSON() ([]byte, error) {
	rid, err := json.Marshal(string(r))
	if err != nil {
		return nil, err
	}
	o := make([]byte, len(rid)+8)
	copy(o, refPrefix)
	copy(o[7:], rid)
	o[len(o)-1] = refSuffix
	return o, nil
}
MarshalJSON makes Ref implement the json.Marshaler interface.
package res
import "encoding/json"
type Ref string
type SoftRef string
type DataValue struct {
	Data interface{} `json:"data"`
}
const (
	refPrefix     = `{"rid":`
	softRefSuffix = `,"soft":true}`
	refSuffix     = '}'
)
type ResourceType byte
const (
	TypeUnset ResourceType = iota
	TypeModel
	TypeCollection
)
var DeleteAction = &struct{ json.RawMessage }{RawMessage: json.RawMessage(`{"action":"delete"}`)}