Skip to content

undefined method `reject' for nil:NilClass for combine_namespace_routes #508

Closed
@mur-wtag

Description

@mur-wtag

For this combine_namespace_routes:

route_param :animal do
  route_param :breed do
    resource :queues do
      route_param :queue_id do
        resource :reservations do
          desc 'Lists all reservations specific type of animal of specific breed in specific queue'
          get do
            animal = params[:animal]
            breed = params[:breed]
            queue = params[:queue_id]
            ::ListReservations.new(animal, breed, queue).results
          end
        end
      end
    end
  end
end

Getting this error:

Exiting
Uncaught exception: undefined method `reject' for nil:NilClass
    /Users/MUR/.rvm/gems/[email protected]/gems/grape-swagger-0.24.0/lib/grape-swagger.rb:103:in `block in combine_namespace_routes'
    /Users/MUR/.rvm/gems/[email protected]/gems/grape-swagger-0.24.0/lib/grape-swagger.rb:98:in `each'
    /Users/MUR/.rvm/gems/[email protected]/gems/grape-swagger-0.24.0/lib/grape-swagger.rb:98:in `combine_namespace_routes'
    /Users/MUR/.rvm/gems/[email protected]/gems/grape-swagger-0.24.0/lib/grape-swagger.rb:52:in `add_swagger_documentation'
    /Users/MUR/src/welltravel.reservationmanagement/app/api/api.rb:79:in `<class:Dispatch>'
    /Users/MUR/src/welltravel.reservationmanagement/app/api/api.rb:4:in `<module:API>'
    /Users/MUR/src/welltravel.reservationmanagement/app/api/api.rb:3:in `<top (required)>'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:457:in `load'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:457:in `block in load_file'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:647:in `new_constants_in'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:456:in `load_file'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:354:in `require_or_load'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:494:in `load_missing_constant'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:184:in `const_missing'
    /Users/MUR/src/welltravel.reservationmanagement/config/routes.rb:5:in `block in <top (required)>'
    /Users/MUR/.rvm/gems/[email protected]/gems/actionpack-4.2.2/lib/action_dispatch/routing/route_set.rb:432:in `instance_exec'
    /Users/MUR/.rvm/gems/[email protected]/gems/actionpack-4.2.2/lib/action_dispatch/routing/route_set.rb:432:in `eval_block'
    /Users/MUR/.rvm/gems/[email protected]/gems/actionpack-4.2.2/lib/action_dispatch/routing/route_set.rb:410:in `draw'
    /Users/MUR/src/welltravel.reservationmanagement/config/routes.rb:1:in `<top (required)>'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `block in load'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/routes_reloader.rb:40:in `each'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/file_update_checker.rb:75:in `call'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/file_update_checker.rb:75:in `execute'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/routes_reloader.rb:27:in `updater'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    /Users/MUR/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!'
    /Users/MUR/src/welltravel.reservationmanagement/config/environment.rb:5:in `<top (required)>'
    /Users/MUR/.rvm/gems/[email protected]/gems/skylight-0.10.6/lib/skylight/probes.rb:81:in `require'
    /Users/MUR/.rvm/gems/[email protected]/gems/skylight-0.10.6/lib/skylight/probes.rb:81:in `require'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `block in require'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
    /Users/MUR/.rvm/gems/[email protected]/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
    /Users/MUR/src/welltravel.reservationmanagement/config.ru:3:in `block in <main>'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
    /Users/MUR/src/welltravel.reservationmanagement/config.ru:in `new'
    /Users/MUR/src/welltravel.reservationmanagement/config.ru:in `<main>'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands/server.rb:61:in `app'
    /Users/MUR/.rvm/gems/[email protected]/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands/server.rb:139:in `log_to_stdout'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands/server.rb:78:in `start'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:80:in `block in server'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    /Users/MUR/.rvm/gems/[email protected]/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
    /Users/MUR/src/welltravel.reservationmanagement/bin/rails:8:in `require'
    /Users/MUR/src/welltravel.reservationmanagement/bin/rails:8:in `<top (required)>'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions