diff --git a/src/jsx.erl b/src/jsx.erl index 953abb8..1e7ded9 100644 --- a/src/jsx.erl +++ b/src/jsx.erl @@ -82,15 +82,15 @@ minify(Source) -> format(Source, []). prettify(Source) -> format(Source, [space, {indent, 2}]). --spec is_json(Source::any()) -> true | false. --spec is_json(Source::any(), Config::jsx_verify:config()) -> true | false. +-spec is_json(Source::any()) -> true | false | {incomplete, decoder()}. +-spec is_json(Source::any(), Config::jsx_verify:config()) -> true | false | {incomplete, decoder()}. is_json(Source) -> is_json(Source, []). is_json(Source, Config) -> jsx_verify:is_json(Source, Config). --spec is_term(Source::any()) -> true | false. --spec is_term(Source::any(), Config::jsx_verify:config()) -> true | false. +-spec is_term(Source::any()) -> true | false | {incomplete, encoder()}. +-spec is_term(Source::any(), Config::jsx_verify:config()) -> true | false | {incomplete, encoder()}. is_term(Source) -> is_term(Source, []). is_term(Source, Config) -> jsx_verify:is_term(Source, Config). diff --git a/src/jsx_verify.erl b/src/jsx_verify.erl index e923691..09a668d 100644 --- a/src/jsx_verify.erl +++ b/src/jsx_verify.erl @@ -35,7 +35,7 @@ -export_type([config/0]). --spec is_json(Source::binary(), Config::config()) -> true | false. +-spec is_json(Source::binary(), Config::config()) -> true | false | {incomplete, jsx:decoder()}. is_json(Source, Config) when is_list(Config) -> try (jsx:decoder(?MODULE, Config, jsx_config:extract_config(Config)))(Source) @@ -43,7 +43,7 @@ is_json(Source, Config) when is_list(Config) -> end. --spec is_term(Source::any(), Config::config()) -> true | false. +-spec is_term(Source::any(), Config::config()) -> true | false | {incomplete, jsx:encoder()}. is_term(Source, Config) when is_list(Config) -> try (jsx:encoder(?MODULE, Config, jsx_config:extract_config(Config)))(Source)