type Refable … // MarshalJSON marshals the ref to json func (r Refable) MarshalJSON() ([]byte, error) { … } // UnmarshalJSON unmarshalss the ref from json func (r *Refable) UnmarshalJSON(d []byte) error { … } type Ref … // RemoteURI gets the remote uri part of the ref func (r *Ref) RemoteURI() string { … } // IsValidURI returns true when the url the ref points to can be found func (r *Ref) IsValidURI(basepaths ...string) bool { … } // Inherits creates a new reference from a parent and a child // If the child cannot inherit from the parent, an error is returned func (r *Ref) Inherits(child Ref) (*Ref, error) { … } // NewRef creates a new instance of a ref object // returns an error when the reference uri is an invalid uri func NewRef(refURI string) (Ref, error) { … } // MustCreateRef creates a ref object but panics when refURI is invalid. // Use the NewRef method for a version that returns an error. func MustCreateRef(refURI string) Ref { … } // MarshalJSON marshals this ref into a JSON object func (r Ref) MarshalJSON() ([]byte, error) { … } // UnmarshalJSON unmarshals this ref from a JSON object func (r *Ref) UnmarshalJSON(d []byte) error { … } func (r *Ref) fromMap(v map[string]interface{ … }