exhal v1.0.0 ExHal.Link

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

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, expected with vars if any are provied

Functions

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

from_embedded(rel, embedded_doc)

Build new link struct from embedded doc.

target_url(a_link, vars \\ %{})

Returns target url, expected with vars if any are provied.

Returns {:ok, "fully_qualified_url"}

      `:error` if link target is anonymous