Skip to content

500 error when include param is empty #1211

@Eunix

Description

@Eunix

This issue is a (choose one):

  • Problem/bug report.
  • Feature request.
  • Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.

Checklist before submitting:

  • I've searched for an existing issue.
  • I've asked my question on Gitter and have not received a satisfactory answer.
  • I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

There is 500 error on branch 0.9.x when trying to access a resource with empty include param, e.g. https://server/resource?include=. The error is no implicit conversion of nil into Array.

Internal Server Error: no implicit conversion of nil into Array /usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/request_parser.rb:219:in `+'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/request_parser.rb:219:in `parse_include_directives'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/request_parser.rb:46:in `setup_index_action'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/request_parser.rb:38:in `setup_action'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/request_parser.rb:27:in `initialize'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/acts_as_resource_controller.rb:66:in `new'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/acts_as_resource_controller.rb:66:in `process_request'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jsonapi-resources-0.9.3/lib/jsonapi/acts_as_resource_controller.rb:16:in `index'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7/lib/abstract_controller/base.rb:188:in `process_action'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7/lib/action_controller/metal/rendering.rb:30:in `process_action'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-5.0.7/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:126:in `call'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:455:in `call'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:448:in `block (2 levels) in around'
/usr/local/var/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:286:in `block (2 levels) in halting'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions