JSON::XS 3.0 changes the way booleans are represented
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenSRF |
Fix Released
|
Medium
|
Unassigned | ||
2.1 |
Fix Committed
|
Medium
|
Unassigned | ||
2.2 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When using JSON::XS to convert objects back and forth between perl and JSON, we look for booleans by nature of them being JSON::XS::Boolean objects.
Starting with JSON::XS 3.0, JSON::XS::Boolean has been replaced with JSON::PP::Boolean. From the JSON::XS::Boolean docs:
"Since 3.0, JSON::PP::Boolean has replaced it. Support for JSON::XS::Boolean will be removed in a future release."
Actually, JSON::XS introduces a dependency on Types::Serialiser, and boolean values are represented as Types::
"For historical reasons, the "Types:
Given a working OpenSRF install, if you upgrade to JSON::XS 3.01 and restart services, you can see broken behavior in srfsh:
Normal operation:
srfsh# request open-ils.actor open-ils.
Received Data: {
"cat.
"cat.
"cat.
"circ.
"cat.
"circ.
"cat.
"circ.
"cat.
}
Operation after upgrading to JSON::XS 3.01 (using "cpan JSON::XS") and restarting services:
srfsh# request open-ils.actor open-ils.
Received Data: {
"cat.
"cat.
"cat.
"circ.
"cat.
"circ.
"cat.
"circ.
"__
"__p":null
},
"cat.
}
Note that the value for circ.grace.extend is no longer "true".
OpenSRF "make check" also fails after installing JSON::XS 3.01.
Two approaches for fixing this, both contained in their own mostly-unpolished but tested working branches. Feedback desired:
user/jeff/
http://
user/jeff/
http://
Changed in opensrf: | |
status: | Fix Committed → Fix Released |
Thanks to Scott Myers for mentioning symptoms after upgrading JSON::XS on one of his systems.
This is probably not something that will affect most supported Linux distributions for an undetermined amount of time. JSON::XS 3.01 was released 2013-10-29 and is not yet packaged in the distros I checked.
If we adapt soon, we'll be ready when 3.x does start showing up in distro packages.