title: Rails Grape API 'id is invalid' in request that requires no id
body: <p>I have a Grape API protected by Doorkeeper and I have a bunch of methods which work perfectly. However, there's one method that behaves weirdly.
  It is a GET request that requires no parameters and running it throws the following error:</p>
  
  <blockquote>
    <p>Grape::Exceptions::ValidationErrors at /v1/discount_cards/all.json</p>
    
    <p>id is invalid</p>
  </blockquote>
  
  <p>My method looks like this:</p>
  
  <pre><code>desc 'Get all the cards of current customer'
  params {}
  get 'all' do
    current_customer.discount_cards.to_json(include:
    {
      barcode: {
        include: :barcode_type
      }
    })
  end
  </code></pre>
  
  <p>The logs say that the error happens at line 17 of the <code>logger.rb</code> file, which looks like this:</p>
  
  <pre><code>module API
    class Logger
      def initialize(app)
        @app = app
      end
  
      def call(env)
        payload = {
          remote_addr: env['REMOTE_ADDR'],
          request_method: env['REQUEST_METHOD'],
          request_path: env['PATH_INFO'],
          request_query: env['QUERY_STRING'],
          x_organization: env['HTTP_X_ORGANIZATION']
        }
  
        ActiveSupport::Notifications.instrument 'grape.request', payload do
          @app.call(env).tap do |response| # &lt;-- logs say the error is here
            payload[:params] = env['api.endpoint'].params.to_hash
            payload[:params].delete('route_info')
            payload[:params].delete('format')
            payload[:response_status] = response[0]
          end
        end
      end
    end
  end
  </code></pre>
  
  <p>My main <code>base.rb</code> class looks like this:</p>
  
  <pre><code>module API
    class Dispatch &lt; Grape::API
      mount API::V1::Base
    end
  
    Base = Rack::Builder.new do
      use API::Logger
      run API::Dispatch
    end
  end
  </code></pre>
  
  <hr>
  
  <p>I really cannot understand what <code>id</code> it is talking about, and, moreover, all the other api methods work absolutely fine (post, get, put, delete).</p>
  
  <p>Could you help me with resolving that issue?</p>