Skip to content
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

JSON::ParserError in Apitome::Docs#index #114

Open
KiranJosh opened this issue Jan 29, 2020 · 16 comments
Open

JSON::ParserError in Apitome::Docs#index #114

KiranJosh opened this issue Jan 29, 2020 · 16 comments

Comments

@KiranJosh
Copy link

Started GET "/api/docs" for ::1 at 2020-01-29 19:34:08 +0530
Processing by Apitome::DocsController#index as HTML
Rendering /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/index.html.erb within layouts/apitome/application
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_explanation.html.erb (Duration: 1.6ms | Allocations: 6077)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_endpoint.html.erb (Duration: 0.1ms | Allocations: 77)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_params.html.erb (Duration: 0.3ms | Allocations: 291)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_route.html.erb (Duration: 0.1ms | Allocations: 77)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_headers.html.erb (Duration: 0.1ms | Allocations: 87)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_query.html.erb (Duration: 0.1ms | Allocations: 83)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_status.html.erb (Duration: 0.1ms | Allocations: 77)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_headers.html.erb (Duration: 0.1ms | Allocations: 92)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_body.html.erb (Duration: 0.8ms | Allocations: 2425)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_example.html.erb (Duration: 4.8ms | Allocations: 10099)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/_all_examples.html.erb (Duration: 5.3ms | Allocations: 10775)
Rendered /home/kiran/.rvm/gems/ruby-2.6.0/gems/apitome-0.3.0/app/views/apitome/docs/index.html.erb within layouts/apitome/application (Duration: 7.1ms | Allocations: 15511)
Completed 500 Internal Server Error in 8ms (ActiveRecord: 0.0ms | Allocations: 16267)

ActionView::Template::Error (JSON::ParserError):
1:


2:

<%= t(:body, scope: :apitome) %>


3:
<%= formatted_body(body, type) %>

4:

apitome (0.3.0) app/controllers/apitome/docs_controller.rb:90:in rescue in formatted_body' apitome (0.3.0) app/controllers/apitome/docs_controller.rb:82:in formatted_body'
actionpack (6.0.2.1) lib/abstract_controller/helpers.rb:67:in formatted_body' apitome (0.3.0) app/views/apitome/docs/_body.html.erb:3 actionview (6.0.2.1) lib/action_view/base.rb:274:in _run'
actionview (6.0.2.1) lib/action_view/template.rb:185:in block in render' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument'
actionview (6.0.2.1) lib/action_view/template.rb:386:in instrument_render_template' actionview (6.0.2.1) lib/action_view/template.rb:183:in render'
actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:358:in block in render_partial' actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:89:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument' activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument' actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:88:in instrument'
actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:347:in render_partial' actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:317:in render'
actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:65:in render_partial_to_object' actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:27:in render_to_object'
actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:22:in render' actionview (6.0.2.1) lib/action_view/helpers/rendering_helper.rb:34:in block in render'
actionview (6.0.2.1) lib/action_view/base.rb:304:in in_rendering_context' actionview (6.0.2.1) lib/action_view/helpers/rendering_helper.rb:30:in render'
haml (5.1.2) lib/haml/helpers/action_view_mods.rb:15:in render' apitome (0.3.0) app/views/apitome/docs/_example.html.erb:26 apitome (0.3.0) app/views/apitome/docs/_example.html.erb:7:in each'
apitome (0.3.0) app/views/apitome/docs/_example.html.erb:7:in each_with_index' apitome (0.3.0) app/views/apitome/docs/_example.html.erb:7 actionview (6.0.2.1) lib/action_view/base.rb:274:in _run'
actionview (6.0.2.1) lib/action_view/template.rb:185:in block in render' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument'
actionview (6.0.2.1) lib/action_view/template.rb:386:in instrument_render_template' actionview (6.0.2.1) lib/action_view/template.rb:183:in render'
actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:358:in block in render_partial' actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:89:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument' activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument' actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:88:in instrument'
actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:347:in render_partial' actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:317:in render'
actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:65:in render_partial_to_object' actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:27:in render_to_object'
actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:22:in render' actionview (6.0.2.1) lib/action_view/helpers/rendering_helper.rb:34:in block in render'
actionview (6.0.2.1) lib/action_view/base.rb:304:in in_rendering_context' actionview (6.0.2.1) lib/action_view/helpers/rendering_helper.rb:30:in render'
haml (5.1.2) lib/haml/helpers/action_view_mods.rb:15:in render' apitome (0.3.0) app/views/apitome/docs/_all_examples.html.erb:10 apitome (0.3.0) app/views/apitome/docs/_all_examples.html.erb:7:in each'
apitome (0.3.0) app/views/apitome/docs/_all_examples.html.erb:7
apitome (0.3.0) app/views/apitome/docs/_all_examples.html.erb:1:in each' apitome (0.3.0) app/views/apitome/docs/_all_examples.html.erb:1 actionview (6.0.2.1) lib/action_view/base.rb:274:in _run'
actionview (6.0.2.1) lib/action_view/template.rb:185:in block in render' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument'
actionview (6.0.2.1) lib/action_view/template.rb:386:in instrument_render_template' actionview (6.0.2.1) lib/action_view/template.rb:183:in render'
actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:358:in block in render_partial' actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:89:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument' activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument' actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:88:in instrument'
actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:347:in render_partial' actionview (6.0.2.1) lib/action_view/renderer/partial_renderer.rb:317:in render'
actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:65:in render_partial_to_object' actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:53:in render_partial'
actionview (6.0.2.1) lib/action_view/helpers/rendering_helper.rb:38:in render' haml (5.1.2) lib/haml/helpers/action_view_mods.rb:15:in render'
apitome (0.3.0) app/views/apitome/docs/index.html.erb:11
actionview (6.0.2.1) lib/action_view/base.rb:274:in _run' actionview (6.0.2.1) lib/action_view/template.rb:185:in block in render'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument' activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument'
activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument' actionview (6.0.2.1) lib/action_view/template.rb:386:in instrument_render_template'
actionview (6.0.2.1) lib/action_view/template.rb:183:in render' actionview (6.0.2.1) lib/action_view/renderer/template_renderer.rb:59:in block (2 levels) in render_template'
actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:89:in block in instrument' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument'
actionview (6.0.2.1) lib/action_view/renderer/abstract_renderer.rb:88:in instrument' actionview (6.0.2.1) lib/action_view/renderer/template_renderer.rb:58:in block in render_template'
actionview (6.0.2.1) lib/action_view/renderer/template_renderer.rb:66:in render_with_layout' actionview (6.0.2.1) lib/action_view/renderer/template_renderer.rb:57:in render_template'
actionview (6.0.2.1) lib/action_view/renderer/template_renderer.rb:13:in render' actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:61:in render_template_to_object'
actionview (6.0.2.1) lib/action_view/renderer/renderer.rb:29:in render_to_object' actionview (6.0.2.1) lib/action_view/rendering.rb:118:in block in _render_template'
actionview (6.0.2.1) lib/action_view/base.rb:304:in in_rendering_context' actionview (6.0.2.1) lib/action_view/rendering.rb:117:in _render_template'
actionpack (6.0.2.1) lib/action_controller/metal/streaming.rb:219:in _render_template' actionview (6.0.2.1) lib/action_view/rendering.rb:103:in render_to_body'
actionpack (6.0.2.1) lib/action_controller/metal/rendering.rb:52:in render_to_body' actionpack (6.0.2.1) lib/action_controller/metal/renderers.rb:142:in render_to_body'
actionpack (6.0.2.1) lib/abstract_controller/rendering.rb:25:in render' actionpack (6.0.2.1) lib/action_controller/metal/rendering.rb:36:in render'
actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:44:in block (2 levels) in render' activesupport (6.0.2.1) lib/active_support/core_ext/benchmark.rb:14:in block in ms'
/home/kiran/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/benchmark.rb:308:in realtime' activesupport (6.0.2.1) lib/active_support/core_ext/benchmark.rb:14:in ms'
actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:44:in block in render' actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:85:in cleanup_view_runtime'
activerecord (6.0.2.1) lib/active_record/railties/controller_runtime.rb:34:in cleanup_view_runtime' actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:43:in render'
actionpack (6.0.2.1) lib/action_controller/metal/implicit_render.rb:35:in default_render' actionpack (6.0.2.1) lib/action_controller/metal/basic_implicit_render.rb:6:in block in send_action'
actionpack (6.0.2.1) lib/action_controller/metal/basic_implicit_render.rb:6:in tap' actionpack (6.0.2.1) lib/action_controller/metal/basic_implicit_render.rb:6:in send_action'
actionpack (6.0.2.1) lib/abstract_controller/base.rb:196:in process_action' actionpack (6.0.2.1) lib/action_controller/metal/rendering.rb:30:in process_action'
actionpack (6.0.2.1) lib/abstract_controller/callbacks.rb:42:in block in process_action' activesupport (6.0.2.1) lib/active_support/callbacks.rb:135:in run_callbacks'
actionpack (6.0.2.1) lib/abstract_controller/callbacks.rb:41:in process_action' actionpack (6.0.2.1) lib/action_controller/metal/rescue.rb:22:in process_action'
actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:33:in block in process_action' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in block in instrument'
activesupport (6.0.2.1) lib/active_support/notifications/instrumenter.rb:24:in instrument' activesupport (6.0.2.1) lib/active_support/notifications.rb:180:in instrument'
actionpack (6.0.2.1) lib/action_controller/metal/instrumentation.rb:32:in process_action' actionpack (6.0.2.1) lib/action_controller/metal/params_wrapper.rb:245:in process_action'
activerecord (6.0.2.1) lib/active_record/railties/controller_runtime.rb:27:in process_action' actionpack (6.0.2.1) lib/abstract_controller/base.rb:136:in process'
actionview (6.0.2.1) lib/action_view/rendering.rb:39:in process' actionpack (6.0.2.1) lib/action_controller/metal.rb:191:in dispatch'
actionpack (6.0.2.1) lib/action_controller/metal.rb:252:in dispatch' actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:51:in dispatch'
actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:33:in serve' actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:49:in block in serve'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in each' actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in serve'
actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:837:in call' railties (6.0.2.1) lib/rails/engine.rb:526:in call'
railties (6.0.2.1) lib/rails/railtie.rb:190:in public_send' railties (6.0.2.1) lib/rails/railtie.rb:190:in method_missing'
actionpack (6.0.2.1) lib/action_dispatch/routing/mapper.rb:19:in block in <class:Constraints>' actionpack (6.0.2.1) lib/action_dispatch/routing/mapper.rb:48:in serve'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:49:in block in serve' actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in each'
actionpack (6.0.2.1) lib/action_dispatch/journey/router.rb:32:in serve' actionpack (6.0.2.1) lib/action_dispatch/routing/route_set.rb:837:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' newrelic_rpm (6.8.0.360) lib/new_relic/rack/agent_hooks.rb:30:in traced_call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' newrelic_rpm (6.8.0.360) lib/new_relic/rack/browser_monitoring.rb:32:in traced_call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' versionist (2.0.1) lib/versionist/middleware.rb:39:in _call'
versionist (2.0.1) lib/versionist/middleware.rb:17:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/tempfile_reaper.rb:17:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/etag.rb:27:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/conditional_get.rb:27:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/head.rb:14:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
actionpack (6.0.2.1) lib/action_dispatch/http/content_security_policy.rb:18:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/session/abstract/id.rb:277:in context' rack (2.1.1) lib/rack/session/abstract/id.rb:271:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' actionpack (6.0.2.1) lib/action_dispatch/middleware/cookies.rb:648:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' activerecord (6.0.2.1) lib/active_record/migration.rb:567:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' actionpack (6.0.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in block in call'
activesupport (6.0.2.1) lib/active_support/callbacks.rb:101:in run_callbacks' actionpack (6.0.2.1) lib/action_dispatch/middleware/callbacks.rb:26:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' actionpack (6.0.2.1) lib/action_dispatch/middleware/executor.rb:14:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' actionpack (6.0.2.1) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' rollbar (2.23.2) lib/rollbar/middleware/rails/rollbar.rb:25:in block in call'
rollbar (2.23.2) lib/rollbar.rb:145:in scoped' rollbar (2.23.2) lib/rollbar/middleware/rails/rollbar.rb:22:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' actionpack (6.0.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:32:in call'
rollbar (2.23.2) lib/rollbar/middleware/rails/show_exceptions.rb:22:in call_with_rollbar' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
web-console (4.0.1) lib/web_console/middleware.rb:132:in call_app' web-console (4.0.1) lib/web_console/middleware.rb:28:in block in call'
web-console (4.0.1) lib/web_console/middleware.rb:17:in catch' web-console (4.0.1) lib/web_console/middleware.rb:17:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' actionpack (6.0.2.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in call'
newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call' railties (6.0.2.1) lib/rails/rack/logger.rb:38:in call_app'
railties (6.0.2.1) lib/rails/rack/logger.rb:26:in block in call' activesupport (6.0.2.1) lib/active_support/tagged_logging.rb:80:in block in tagged'
activesupport (6.0.2.1) lib/active_support/tagged_logging.rb:28:in tagged' activesupport (6.0.2.1) lib/active_support/tagged_logging.rb:80:in tagged'
railties (6.0.2.1) lib/rails/rack/logger.rb:26:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/remote_ip.rb:81:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
request_store (1.5.0) lib/request_store/middleware.rb:19:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/request_id.rb:27:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/method_override.rb:24:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/runtime.rb:24:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
activesupport (6.0.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/executor.rb:14:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/static.rb:126:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
rack (2.1.1) lib/rack/sendfile.rb:113:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
actionpack (6.0.2.1) lib/action_dispatch/middleware/host_authorization.rb:83:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
railties (6.0.2.1) lib/rails/engine.rb:526:in call' newrelic_rpm (6.8.0.360) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'
puma (3.12.2) lib/puma/configuration.rb:227:in call' puma (3.12.2) lib/puma/server.rb:674:in handle_request'
puma (3.12.2) lib/puma/server.rb:476:in process_client' puma (3.12.2) lib/puma/server.rb:334:in block in run'
puma (3.12.2) lib/puma/thread_pool.rb:135:in `block in spawn_thread'

@bf4
Copy link
Contributor

bf4 commented Jan 30, 2020

fwiw, I'm researching this now myself. looks like you're on rails 6.0.2.1. I'm on Rails 5.2. did you just upgrade rails? have you ever had it working?

@jejacks0n
Copy link
Owner

Any fix for this would be appreciated. =) I currently don't have time to look into it.

@bf4
Copy link
Contributor

bf4 commented Jan 30, 2020

I think this is a duplicate of #113

@bf4
Copy link
Contributor

bf4 commented Jan 30, 2020

Issue for me appears to be that rspec_api_documentation may return the string "[binary data]" as the response body, and this makes apitome blow up.

https://github.com/zipmark/rspec_api_documentation/blob/560c3bdc7bd5581e7c223334390221ecfc910be8/lib/rspec_api_documentation/client_base.rb#L88-L96

I'd like to propose adding a user-configurable error handler to handle this in addition to a fix

either in the controller

def formatted_body(body, type)
if type =~ /json/ && body.present?
JSON.pretty_generate(JSON.parse(body))
else
body
end
rescue JSON::ParserError
return body if body == " "
raise JSON::ParserError
end

or in the view which knows which request is the problematic one

<% example['requests'].each_with_index do |request, index| %>
<div id="<%= "request-#{index}" %>">
<h3><%= t(:request, scope: :apitome) %></h3>
<div class="request">
<%= render partial: 'apitome/docs/route', locals: {request: request, index: index} %>
<%= render partial: 'apitome/docs/headers', locals: {request: request, index: index, headers: request['request_headers']} %>
<%= render partial: 'apitome/docs/query', locals: {request: request, index: index} unless request['request_query_parameters'].empty? %>
<%= render partial: 'apitome/docs/body', locals: {request: request, index: index, body: request['request_body'], type: request['request_content_type']} if request['request_body'] %>
<%= render partial: 'apitome/docs/curl', locals: {request: request, index: index} if request['curl'] %>
</div>
<h3><%= t(:response, scope: :apitome) %></h3>
<div class="response">
<%- if Apitome.configuration.simulated_response %>
<%= link_to('Simulated Response', simulated_path(example[:link])) if example[:link].present? %>
<%- end %>
<%= render partial: 'apitome/docs/response_fields', locals: {params: example['response_fields']} if example['response_fields'].size > 0 %>
<%= render partial: 'apitome/docs/status', locals: {request: request, index: index} %>
<%= render partial: 'apitome/docs/headers', locals: {request: request, index: index, headers: request['response_headers']} %>
<%= render partial: 'apitome/docs/body', locals: {request: request, index: index, body: request['response_body'], type: request['response_content_type']} if request['response_body'] %>
</div>

@bf4 bf4 mentioned this issue Jan 30, 2020
@bf4
Copy link
Contributor

bf4 commented Jan 30, 2020

I made a PR #115

gonna test it in my app

@KiranJosh
Copy link
Author

fwiw, I'm researching this now myself. looks like you're on rails 6.0.2.1. I'm on Rails 5.2. did you just upgrade rails? have you ever had it working?

I have integrated apitome in new app only. It was working before upgrading rspec-rails to 4.0.0.

@KiranJosh
Copy link
Author

I made a PR #115

gonna test it in my app

Thanks, its working.

@bf4
Copy link
Contributor

bf4 commented Jan 31, 2020

Issue was a change in rack and naive logic in rspec api doc with poor handling in apitome

@alejandro-vericatch
Copy link

Hey guys, could you release the fixes #115? I would appreciate it. Thanks!

@Payal13
Copy link

Payal13 commented Jun 29, 2020

I am facing the same issue. What should I do ? is this fix released?

@alejandro-vericatch
Copy link

I am facing the same issue. What should I do ? is this fix released?

Have a look at issue #115, there fix the problem.

@ukazap
Copy link

ukazap commented Jul 20, 2020

Update the Gemfile for temporary fix:

gem "apitome", github: "jejacks0n/apitome"

@ShamoX
Copy link

ShamoX commented Aug 27, 2020

@jejacks0n Can you release the fix please ?
I made a PR #118 that fixes the build

@daviidy
Copy link

daviidy commented Apr 18, 2021

Update the Gemfile for temporary fix:

gem "apitome", github: "jejacks0n/apitome"

It worked for me. Thanks!

@ratnarajsukale
Copy link

gem "apitome", github: "jejacks0n/apitome"
this works

@xrnm
Copy link

xrnm commented Feb 8, 2022

Seeing as #115 has been merged should this be marked as closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants