]> git.evergreen-ils.org Git - working/OpenSRF.git/commit
LP#1285915: document that perl2JSON doesn't order hash keys
authorGalen Charlton <gmc@esilibrary.com>
Wed, 2 Apr 2014 22:24:06 +0000 (15:24 -0700)
committerBill Erickson <berick@esilibrary.com>
Fri, 2 May 2014 18:12:39 +0000 (14:12 -0400)
commit8fb4405a2768dd752743dab71d6e2e8a50ee6cd5
tree4f7e8d37602138bbc5ab3a9e5f3985d5cd971e60
parent8a8b4cbbae62d3e927b24541f31fec93949b1752
LP#1285915: document that perl2JSON doesn't order hash keys

This patch documents that JSON strings returned by
OpenSRF::Utils::JSON->perl2JSON() should not be expected to have
hash keys sorted in any particular order.  It also adjusts a
corresponding test case to consistently pass under Perl 5.18, which
introduces hash order randomization.

Forcing JSON output to be in canonical form is another option, and
easily done by JSON::XS, but would add overhead.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
src/perl/lib/OpenSRF/Utils/JSON.pm
src/perl/t/09-Utils-JSON.t