Closed hokuma closed 7 years ago
Using with rails may cause this errors.
In non-rails project(Gemfile includes only json_schema), it works.
In rails 4.1.15 and 5.0.0.1 with latest json_schema(0.14.3), fails to extract links
.
In rails 4.1.15 and 5.0.0.1 with downgraded json_schema(0.14.1), it works.
@hokuma Sorry to hear about the trouble!
Could you try cloning down this repository and seeing if you can reproduce the problem? https://github.com/brandur/json_schema-bug-reproduction-suite
I bundled Rails in and tried requiring some of its standard libraries, but haven't been able to reproduce yet.
@brandur Thank you for your response.
I tried in https://github.com/brandur/json_schema-bug-reproduction-suite, and app.rb
didn't cause any errors.
But calling inspect
reproduced errors.
puts schema.definitions['app'].links.inspect
Originally, I saw this errors in rails console(same as irb
) which use inspect
for output. json_schema has the same method which is defined in here.
It seems that this conflict cause the errors.
Altogether, there is no problem to extract links except irb
enviroment.
@hokuma Aha! Thank you.
That actually makes sense. The test coverage on #inspect
is atrocious right now and that whole method needs to be reimplemented. I'll take a look at a fix.
Fix released as 0.14.4. Sorry about the trouble here :/
v0.14.3 fails to extract
links
.This is
sample_schema.json
(extracted from https://github.com/brandur/json_schema/blob/master/test/data_scaffold.rb#L8 )