braise v0.3.0 Braise.Schema

The structured representation of the parse JSON file for JSON Schema.

Summary

Functions

Returns a collection of resources that we can generate adapter and model files from. The resource is the combination of a name, uri, definition, and response

Returns a parsed URI from the JSON schema segment that contains the root of the API we are trying to build Ember files out of

Functions

resources(schema, collection \\ [])

Returns a collection of resources that we can generate adapter and model files from. The resource is the combination of a name, uri, definition, and response.

The response represents what should be returned by the specific resource, the definition contains specifically what each attribute in the response means. We have to later dereference the response with the provided definition.

url(arg1)

Returns a parsed URI from the JSON schema segment that contains the root of the API we are trying to build Ember files out of.

Examples

iex > Braise.Schema.url([%{"href" => "http://bizdev.lol"}])
{:ok, %URI{authority: "bizdev.lol", fragment: nil, host: "bizdev.lol", path: nil, port: 80, query: nil, scheme: "http", userinfo: nil}

iex > Braise.Schema.url("imma invalid schema")
{:error, "Invalid links portion of JSON Schema"}