jnunemaker / crack

Really simple JSON and XML parsing, ripped from Merb and Rails.
MIT License
541 stars 93 forks source link

Key mangling when using two dates #56

Closed ghost closed 8 years ago

ghost commented 8 years ago

There is some odd key mangling going on when there are two dates in a row. I have verified that with the 'json' gem, that this does not happen. Here is a short ruby script that demonstrates the issue:

require 'crack' require 'json' json_str = '{ "first_date": "2016-01-25", "second_date": "2016-01-25" }' puts JSON.pretty_generate(Crack::JSON.parse(json_str))

output

{ "first_date": "2016-01-25", "sec!!timestamp nd_date": "2016-01-25" }

jnunemaker commented 8 years ago

Fixed by https://github.com/jnunemaker/crack/pull/57