-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work in JRuby (1.7.10 or 1.7.6) with --1.8 #95
Comments
I'll take a look in the next couple of days - thanks! I do need to take some time and lock out the 1.9-specific tests when on 1.8. That seems to be an odd error to encounter, as 1.9 doesn't allow hash editing during iteration, and your schema/payload verify fine in MRI 1.9.3. |
Looking at the sourcecode that throws the error: https://github.com/hoxworth/json-schema/blob/master/lib/json-schema/util/hash.rb I'm wondering if that's part of the problem, something isn't cooperating in there. I can try to use the backports implementation to update the |
Ahh, that's entirely possible. I didn't want to require the backports gem just to use json-schema with 1.8, but conflicts definitely could arise here. I'd rather use their implementation, to be honest, as long as it works cleanly. I'll test that out later this afternoon. Thanks for digging! |
So, for grins, I just added teh backport gem, and tried to use their implementation entirely. Same error. I think it has to do with the schema.rb file, where the add_indifferent_access is happening, because it's modifying the hash during iteration (which is the error heh) so I don't think it's a backports problem, I think it's the way that hash is being updated to have indifferent access. |
Yep, and that's why 1.9 wouldn't have an issue, since that method is already defined. I'll clean that up. |
This should be working now, partly because we test jruby on Travis (although admittedly in 1.9 mode, not 1.8) and partly because we've tidied up the test suite to run on Ruby 1.8. You will need to install the multi_json gem though (and a json parser that multi json supports) |
I'm going to close this but please reopen if it's still an issue |
I know this is like the edge case of edge cases, but I'm working on an old old old old application that is still stuck in Ruby 1.8 land because of SOAP stuff :( Trying to get it onto Jruby, so that I can do some measure of paralleizing and such taking advantage of the powerful JVM.
I haven't tested it in --1.9 because I can't run 1.9 mode with the old SOAP4R crap I have :(
I'm unable to run the validation logic:
Schema: https://gist.github.com/dkowis/9240d79f1126c8b495a1
Payload: https://gist.github.com/dkowis/ef2967f72571ecba06c3
turning these into JSON, and then calling
JSON::Validator.validate!(schema,payload,:validate_schema => true)
And I get this exception.
I'd push it up on a branch, but I can't run most of the other tests because they're using the new ruby 1.9 hash syntax, and that doesn't cooperate obviously. It should be very easy to duplicate using the data here.
The text was updated successfully, but these errors were encountered: