Skip to content

Commit e4a08a5

Browse files
Merge pull request #3103 from rabbitmq/jsx-3.1-backport
Backport #3102 (bump JSX to 3.1)
2 parents c8d9feb + eab047e commit e4a08a5

File tree

6 files changed

+14
-19
lines changed

6 files changed

+14
-19
lines changed

deps/rabbitmq_aws/src/rabbitmq_aws_json.erl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,8 @@
1515
decode(Value) when is_list(Value) ->
1616
decode(list_to_binary(Value));
1717
decode(Value) when is_binary(Value) ->
18-
% We set an empty list of options because we don't want the default
19-
% options set in rabbit_json:cecode/1. And we can't override
20-
% 'return_maps' with '{return_maps, false}' because of a bug in jsx's
21-
% options handler.
22-
% See https://github.com/talentdeficit/jsx/pull/115
23-
Decoded0 = rabbit_json:decode(Value, []),
24-
Decoded = if
25-
is_map(Decoded0) -> maps:to_list(Decoded0);
26-
is_list(Decoded0) -> Decoded0
27-
end,
18+
Decoded0 = rabbit_json:decode(Value, [{return_maps, false}]),
19+
Decoded = rabbit_data_coercion:to_proplist(Decoded0),
2820
convert_binary_values(Decoded, []).
2921

3022

deps/rabbitmq_federation_management/test/federation_mgmt_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ assert_code(CodeExp, CodeAct, Type, Path, Body) ->
244244
end.
245245

246246
decode(?OK, _Headers, ResBody) ->
247-
cleanup(rabbit_json:decode(rabbit_data_coercion:to_binary(ResBody)));
247+
JSON = rabbit_data_coercion:to_binary(ResBody),
248+
cleanup(rabbit_json:decode(JSON));
248249
decode(_, Headers, _ResBody) -> Headers.
249250

250251
cleanup(L) when is_list(L) ->

deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
assert_keys/2, assert_no_keys/2,
1919
http_get/2, http_get/3, http_get/5,
2020
http_get_no_auth/3,
21-
http_get_no_map/2,
21+
http_get_as_proplist/2,
2222
http_put/4, http_put/6,
2323
http_post/4, http_post/6,
2424
http_upload_raw/8,
@@ -1089,12 +1089,12 @@ queues_well_formed_json_test(Config) ->
10891089
http_put(Config, "/queues/%2F/foo", Good, {group, '2xx'}),
10901090
http_put(Config, "/queues/%2F/baz", Good, {group, '2xx'}),
10911091

1092-
Queues = http_get_no_map(Config, "/queues/%2F"),
1092+
Queues = http_get_as_proplist(Config, "/queues/%2F"),
10931093
%% Ensure keys are unique
10941094
[begin
1095-
Sorted = lists:sort(Q),
1096-
Sorted = lists:usort(Q)
1097-
end || Q <- Queues],
1095+
Q = rabbit_data_coercion:to_proplist(Q0),
1096+
?assertEqual(lists:sort(Q), lists:usort(Q))
1097+
end || Q0 <- Queues],
10981098

10991099
http_delete(Config, "/queues/%2F/foo", {group, '2xx'}),
11001100
http_delete(Config, "/queues/%2F/baz", {group, '2xx'}),

deps/rabbitmq_management/test/rabbit_mgmt_only_http_SUITE.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
-import(rabbit_mgmt_test_util, [assert_list/2, assert_item/2, test_item/2,
1818
assert_keys/2, assert_no_keys/2,
1919
http_get/2, http_get/3, http_get/5,
20-
http_get_no_map/2,
20+
http_get_as_proplist/2,
2121
http_put/4, http_put/6,
2222
http_post/4, http_post/6,
2323
http_upload_raw/8,
@@ -609,7 +609,7 @@ queues_well_formed_json_test(Config) ->
609609
http_put(Config, "/queues/%2F/foo", Good, {group, '2xx'}),
610610
http_put(Config, "/queues/%2F/baz", Good, {group, '2xx'}),
611611

612-
Queues = http_get_no_map(Config, "/queues/%2F"),
612+
Queues = http_get_as_proplist(Config, "/queues/%2F"),
613613
%% Ensure keys are unique
614614
[begin
615615
Sorted = lists:sort(Q),

deps/rabbitmq_management/test/rabbit_mgmt_rabbitmqadmin_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ host(Config) ->
108108
{ok, _} = run(Config, ["show", "overview"]),
109109
{ok, _} = run(Config, ["--host", "localhost", "show", "overview"]),
110110
{error, _, _} = run(Config, ["--host", "some-host-that-does-not-exist",
111+
"--request-timeout", "5",
111112
"show", "overview"]).
112113

113114
base_uri(Config) ->
@@ -116,6 +117,7 @@ base_uri(Config) ->
116117
{ok, _} = run(Config, ["--base-uri", "http://localhost", "--vhost", "/", "list", "exchanges"]),
117118
{ok, _} = run(Config, ["--base-uri", "http://localhost/", "--vhost", "/", "list", "exchanges"]),
118119
{error, _, _} = run(Config, ["--base-uri", "https://some-host-that-does-not-exist:15672/",
120+
"--request-timeout", "5",
119121
"list", "exchanges"]),
120122
{error, _, _} = run(Config, ["--base-uri", "http://localhost:15672/", "--vhost", "some-vhost-that-does-not-exist",
121123
"list", "exchanges"]).

rabbitmq-components.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ dep_toke = git_rmq toke $(current_rmq_ref
110110
dep_accept = hex 0.3.5
111111
dep_cowboy = hex 2.8.0
112112
dep_cowlib = hex 2.9.1
113-
dep_jsx = hex 2.11.0
113+
dep_jsx = hex 3.1.0
114114
dep_lager = hex 3.9.2
115115
dep_looking_glass = git https://github.com/rabbitmq/looking_glass master
116116
dep_prometheus = hex 4.6.0

0 commit comments

Comments
 (0)