Sha256: 6b0773e6cd89265c1b0131c895d38c86b69c923d60a27fc139fa242e4d7b8b81

Contents?: true

Size: 631 Bytes

Versions: 5

Compression:

Stored size: 631 Bytes

Contents

class Dummy::CompanyAPI < IntrospectiveGrape::API
  paginate

  restful Company, [:id, :name, :short_name, :gizmos, :widgets, :sprockets] do

    desc "Test default values in an extra endpoint"
    params do
      optional :boolean_default, type: Virtus::Attribute::Boolean, default: false
      optional :string_default, type: String, default: "foo"
      optional :integer_default, type: Integer, default: 123
    end
    get '/special/list' do
      authorize Company.new, :index?
      present params
    end

  end

  class CompanyEntity < Grape::Entity
    expose :id, :name, :short_name, :created_at, :updated_at
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
introspective_grape-0.4.3 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.4.2 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.4.1 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.4.0 spec/dummy/app/api/dummy/company_api.rb
introspective_grape-0.3.9 spec/dummy/app/api/dummy/company_api.rb