Surgex v2.8.0 Surgex.Parser.IncludeParser

Parses the JSON API’s include parameter according to the JSON API spec.

Produces a list of includes constrained to the provided relationship paths.

Summary

Functions

Flattens the result of the parser (inclusion list) into multiple keys

Functions

flatten(input, key)

Flattens the result of the parser (inclusion list) into multiple keys.

Examples

iex> IncludeParser.flatten({:ok, include: [:user]}, :include)
{:ok, include_user: true}