voxpupuli / json-schema

Ruby JSON Schema Validator
MIT License
1.52k stars 242 forks source link

Oj gem with version 3.3.7 or more #399

Open Jesterovskiy opened 6 years ago

Jesterovskiy commented 6 years ago

When I updated Oj gem I get issue: JSON::ParserError: Empty input at line 1, column 1 [parse.c:926] This is because in new Oj version, for line https://github.com/ruby-json-schema/json-schema/blob/c12f6000795cc0fdf8d17d97d5bf9c1b383037e4/lib/json-schema/validator.rb#L527 if you send string with path to JSON file for parsing, you get this exception

mzishtiaq commented 6 years ago

@Jesterovskiy Hey there, did you manage to solve this issue? It looks like there haven't been any updates on this gem for a while. :)

Jesterovskiy commented 6 years ago

@mzishtiaq gem 'oj', '3.3.6', I don't have time to fix it =(

leoarnold commented 6 years ago

@Jesterovskiy Let me guess: Your Gemfile.lock contains multi_json, right?

Jesterovskiy commented 6 years ago

@mzishtiaq https://github.com/ohler55/oj/issues/441 you can start from this issue

Jesterovskiy commented 6 years ago

@leoarnold yes, you right

leoarnold commented 6 years ago

Everyone affected: please also read this explanation: https://github.com/ohler55/oj/issues/441#issuecomment-355593741

leoarnold commented 6 years ago

There is actually a long history of effort to eliminate the usage of multi_json in json-schema, but sadly it looks like efforts have stalled: #339

mzishtiaq commented 6 years ago

@leoarnold Thanks for the detailed explanation. That was very helpful indeed.

leoarnold commented 6 years ago

@Jesterovskiy This might be solved when using multi_json v1.13.0, see https://github.com/intridea/multi_json/pull/183

mzishtiaq commented 6 years ago

@leoarnold @Jesterovskiy I can confirm that this has solved the problem and it's working now.

Jesterovskiy commented 6 years ago

I'm trying to ping @iainbeeston to merge his PR. I think, that multi-JSON not needed.