From e521a9f5fc9adaf3a3bbc35bf44ff26358404603 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Thu, 2 Nov 2023 15:40:20 +0700 Subject: [PATCH] fix(utils): denote `emqx_jsonish` follows access module behaviour Defined in `emqx_template`. --- apps/emqx_utils/src/emqx_jsonish.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/emqx_utils/src/emqx_jsonish.erl b/apps/emqx_utils/src/emqx_jsonish.erl index b2d92c7fc..ef26da1d8 100644 --- a/apps/emqx_utils/src/emqx_jsonish.erl +++ b/apps/emqx_utils/src/emqx_jsonish.erl @@ -16,6 +16,7 @@ -module(emqx_jsonish). +-behaviour(emqx_template). -export([lookup/2]). -export_type([t/0]). @@ -53,11 +54,11 @@ lookup(Loc, Decoded, [Prop | Rest], Jsonish) when is_map(Jsonish) -> {error, Reason} -> {error, Reason} 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 Value -> % NOTE: This is intentional, we don't want to parse nested JSON. - lookup(Loc, true, Rest, Value) + lookup(Loc, true, Props, Value) catch error:_ -> {error, {Loc, binary}}