class SampleApi < Grape::API
  resource 'widgets' do
    desc 'widgets list'
    get '/' do
    end

    desc 'individual widget'
    get ':id' do
    end

    desc 'create a widget'
    params do
      requires :name,
        type: 'string',
        desc: 'the widgets name',
        documentation: { example: 'super widget' }
      optional :description,
        type: 'string',
        desc: 'the widgets name',
        documentation: { example: 'the best widget ever made' }
    end
    post '/' do
    end

    desc 'update a widget'
    params do
      optional :name, type: 'string', desc: 'the widgets name'
      optional :description, type: 'string', desc: 'the widgets name'
    end
    put ':id' do
    end
  end

  resource 'admin' do
    get '/' do
    end
  end
end

class SampleApi < Grape::API
  resource 'widgets' do
    desc 'widgets list'
    get '/' do
    end

    desc 'individual widget'
    get ':id' do
    end

    desc 'create a widget'
    params do
      requires 'name',
        type: String,
        desc: 'the widgets name',
        documentation: { example: 'super widget' }
      optional :description,
        type: String,
        desc: 'the widgets name',
        documentation: { example: 'the best widget ever made' }
    end
    post '/' do
    end

    desc 'update a widget'
    params do
      optional :name, type: String, desc: 'the widgets name'
      optional :description, type: String, desc: 'the widgets name'
    end
    put ':id' do
    end
  end

  resource 'admin' do
    get '/' do
    end
  end
end

Use actual type when defining param in sample api
Use actual type when defining param in sample api

As of grape v0.15.0 it seems the type is being checked and an actual
type is required. Using a string will cause a problem
[here](https://github.com/ruby-grape/grape/blob/v0.15.0/lib/grape/validations/types.rb#L117-L123)
