You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I'm not sure who's right here. Well, actually Crack is probably right -- honestly it surprises me that no other parser recognizes this time format, unless it's not in the JSON spec or something. However, that's the reality.
Here's the context. I'm trying to use Webmock to test some HTTP requests in our Rails app. Data from the database is being sent across the wire as JSON, so it's being JSONized by ActiveSupport. However, Webmock uses Crack (presumably to be framework agnostic) to compare what's being sent. Even though the expected data is the exact same as the actual data, Webmock doesn't see it that way, because Crack is converting something ActiveSupport isn't.
So, I can certainly get around this, but it kinda bothers me. Not only are all the other parsers in agreement, if Crack is just borrowing code from Rails -- and surely whoever wrote the JSON code in Rails consulted other JSON parsers and/or the spec -- I'm not sure there's a reason Crack should make up its own rules (even if it's actually an improvement). At the same time, I realize it's tough, because at this point people are probably relying on what Crack does now.
Thoughts/ideas?
The text was updated successfully, but these errors were encountered:
I know support for the ISO 8601 time format was added a while back, but it seems to be inconsistent with how everyone else parses stuff. Observe:
That's activesupport 2.3.8, json 1.4.6, crack 0.1.8. Here's yajl-ruby 0.7.8:
And here's the default behavior of activesupport 3.0.1:
So, I'm not sure who's right here. Well, actually Crack is probably right -- honestly it surprises me that no other parser recognizes this time format, unless it's not in the JSON spec or something. However, that's the reality.
Here's the context. I'm trying to use Webmock to test some HTTP requests in our Rails app. Data from the database is being sent across the wire as JSON, so it's being JSONized by ActiveSupport. However, Webmock uses Crack (presumably to be framework agnostic) to compare what's being sent. Even though the expected data is the exact same as the actual data, Webmock doesn't see it that way, because Crack is converting something ActiveSupport isn't.
So, I can certainly get around this, but it kinda bothers me. Not only are all the other parsers in agreement, if Crack is just borrowing code from Rails -- and surely whoever wrote the JSON code in Rails consulted other JSON parsers and/or the spec -- I'm not sure there's a reason Crack should make up its own rules (even if it's actually an improvement). At the same time, I realize it's tough, because at this point people are probably relying on what Crack does now.
Thoughts/ideas?
The text was updated successfully, but these errors were encountered: