braise v0.3.0 Braise.Dereferencer

Summary

Functions

Given a map of resources and definitions apply the definitions and to dereference any “$ref”s Return the dereferenced map of resources

Functions

dereference(resources, definitions)

Given a map of resources and definitions apply the definitions and to dereference any “$ref”s Return the dereferenced map of resources

Examples

iex > resources = %{"first_name" => %{"format" => nil, "name" => "first_name", "type" => ["pirate"]},"guid" => %{"$ref" => "/definitions/pirate/definitions/guid"}}
iex > definitions = %{"definitions" => %{"pirate" => %{"definitions" => %{"guid" => %{"type" => ["string"]}}}}}
iex > Braise.Dereferencer.dereference(resources, definitions)
%{"first_name" => %{"format" => nil, "name" => "first_name", "type" => ["pirate"]}, "guid" => %{"type" => ["string"]}}