exhal v7.0.0 ExHal.Link

A Link is a directed reference from one resource to another resource. They are found in the _links and _embedded sections of a HAL document

Link to this section Summary

Functions

Expands “curie”d link rels using the namespaces found in the curies link

Build new link struct from embedded doc

Build new link struct from _links entry

Returns target url, expanded with vars if any are provided

Returns target url, expanded with vars if any are provided

Returns a map that matches the shape of the intended JSON output

Link to this section Functions

Link to this function embedded?(link)
Link to this function expand_curie(link, namespaces)

Expands “curie”d link rels using the namespaces found in the curies link.

Returns [%Link{}, ...] a link struct for each possible variation of the input link

Link to this function from_embedded(rel, embedded_doc)

Build new link struct from embedded doc.

Link to this function target_url(a_link, vars \\ %{})

Returns target url, expanded with vars if any are provided.

Returns {:ok, "fully_qualified_url"}

      `:error` if link target is anonymous
Link to this function target_url!(a_link, vars \\ %{})

Returns target url, expanded with vars if any are provided.

Returns "fully_qualified_url" or raises exception

Link to this function to_json_hash(link)

Deprecated See to_json_map/1

Link to this function to_json_map(link)

Returns a map that matches the shape of the intended JSON output.