Sha256: f0b0e2355856486ae09ab9de0ab8cc1974992397b79ec3700110ee690bfe9a66

Contents?: true

Size: 1.29 KB

Versions: 18

Compression:

Stored size: 1.29 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic"s license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

unless ::Grape::VERSION == '0.1.5'
  module GrapeVersioning
    class ApiV1 < Grape::API
      version 'v1'

      format :json

      get do
        "root"
      end

      resource :fish do
        get do
          "api v1"
        end
      end
    end

    class ApiV2 < Grape::API
      version 'v2', :using => :param

      format :json

      resource :fish do
        get do
          "api v2"
        end
      end
    end

    class ApiV3 < Grape::API
      version 'v3', :using => :header, :vendor => "newrelic"

      format :json

      resource :fish do
        get do
          "api v3"
        end
      end
    end

    class ApiV4 < Grape::API
      #version from http accept header is not supported in older versions of grape
      if NewRelic::VersionNumber.new(Grape::VERSION) >= NewRelic::VersionNumber.new('4.0.0')
        version 'v4', :using => :accept_version_header
      end

      format :json

      resource :fish do
        get do
          "api v4"
        end
      end
    end

    class Unversioned < Grape::API
      format :json

      resource :fish do
        get do
          "api v5"
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
newrelic_rpm-3.16.0.318 test/multiverse/suites/grape/grape_versioning_test_api.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.15.2.317 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.15.1.316 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.15.0.314 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.14.3.313 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.14.2.312 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.14.1.311 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.14.0.305 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.13.2.302 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.13.1.300 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.13.0.299 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.12.1.298 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.12.0.288 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.11.2.286 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.11.1.284 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.11.0.283 test/multiverse/suites/grape/grape_versioning_test_api.rb
newrelic_rpm-3.10.0.279 test/multiverse/suites/grape/grape_versioning_test_api.rb