fix(utils): denote `emqx_jsonish` follows access module behaviour
Defined in `emqx_template`.
This commit is contained in:
parent
b5b6c3f8cc
commit
e521a9f5fc
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
-module(emqx_jsonish).
|
-module(emqx_jsonish).
|
||||||
|
|
||||||
|
-behaviour(emqx_template).
|
||||||
-export([lookup/2]).
|
-export([lookup/2]).
|
||||||
|
|
||||||
-export_type([t/0]).
|
-export_type([t/0]).
|
||||||
|
@ -53,11 +54,11 @@ lookup(Loc, Decoded, [Prop | Rest], Jsonish) when is_map(Jsonish) ->
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{error, Reason}
|
{error, Reason}
|
||||||
end;
|
end;
|
||||||
lookup(Loc, _Decoded = false, Rest, Json) when is_binary(Json) ->
|
lookup(Loc, _Decoded = false, Props, Json) when is_binary(Json) ->
|
||||||
try emqx_utils_json:decode(Json) of
|
try emqx_utils_json:decode(Json) of
|
||||||
Value ->
|
Value ->
|
||||||
% NOTE: This is intentional, we don't want to parse nested JSON.
|
% NOTE: This is intentional, we don't want to parse nested JSON.
|
||||||
lookup(Loc, true, Rest, Value)
|
lookup(Loc, true, Props, Value)
|
||||||
catch
|
catch
|
||||||
error:_ ->
|
error:_ ->
|
||||||
{error, {Loc, binary}}
|
{error, {Loc, binary}}
|
||||||
|
|
Loading…
Reference in New Issue