FlowRunner.SpecLoader behaviour (flow_runner v6.15.1)

Copy Markdown

A macro to help loading of JSON floip specs into structs.

Some keys need some extra help when loading, for when that is the case list those key names under the using key.

Example

defmodule FlowRunner.SomeSpecType do

use FlowRunner.SpecLoader

end defmodule FlowRunner.SomeSpecType do

use FlowRunner.SpecLoader, using: %{"some_field" => FlowRunner.Spec.SomeField}

end

Summary

Callbacks

cast!(blocks_module, arg2)

@callback cast!(blocks_module :: module(), map() | [map()]) :: any() | [any()]

load!(blocks_module, arg2)

@callback load!(blocks_module :: module(), map() | [map()]) :: any() | [any()]

validate!(blocks_module, any)

@callback validate!(blocks_module :: module(), any()) :: any()

Functions

load!(blocks_module, mod, struct, manually_loaded_fields)

validate!(blocks_module, impl)

Validate a struct using Vex.validate