Forum: Ruby on Rails ActiveSupport::JSON.decode issue

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F8d9ece58e97250910d1588b54149415?d=identicon&s=25 Diogo Almeida (diabolic)
on 2009-04-13 10:37
(Received via mailing list)
Good evening,

I'm having a rather odd JSON decoding issue when attempting to decode
an RPX JSON response containing the profile data.

Using the command test = ActiveSupport::JSON.decode, passing it the

{\"formatted\":\"Test Name\"},\"address\":{\"country\":\"United Kingdom
\"},\"displayName\":\"Test Name\",\"preferredUsername\":\"Test\",\"url

The command executes without any warning or exception. However when I
run the following on IRB I get an odd result:

irb(main):085:0> test["profile"]["birthday"]
=> "19 1-02-10"

In the JSON string, if I replace \"http:\\/\\/\\/\"
with just \"http\" everything works as expected and the value gets
interpreted as an instance of the Date class.

Could someone help me find the right direction on this one? Rather
lost ;)

Best regards,
F8d9ece58e97250910d1588b54149415?d=identicon&s=25 Diogo Almeida (diabolic)
on 2009-04-13 18:21
(Received via mailing list)

After dropping the ActiveSupport JSON decoder for the parser available
at everything started working as intended.

Best regards,
This topic is locked and can not be replied to.