Packages

a simple type safe validator

Current section

Files

Jump to
apollo src apollo.erl
Raw

src/apollo.erl

-module(apollo).
-compile([no_auto_import, nowarn_unused_vars]).
-export([validate/2, typed/2]).
-spec validate(apollo@t:schema(FEM), any()) -> {ok, FEM} | {error, binary()}.
validate(Schema, Obj) ->
ffi_apollo:validate(Schema, Obj).
-spec typed(any(), list({binary(), apollo@t:value()})) -> apollo@t:schema(any()).
typed(Type_, Schema) ->
ffi_apollo:typed(Type_, Schema).