Sha256: 043be11e2310c15cbc25393ba2ce9f9c7d086457079c3e3f67667aaf03e00826

Contents?: true

Size: 504 Bytes

Versions: 3

Compression:

Stored size: 504 Bytes

Contents

require 'spec_helper'

describe 'an operation id api' do
  def app
    Class.new(Grape::API) do
      version '0.1'

      desc 'Show this endpoint'
      get '/simple_opp' do
        { foo: 'bar' }
      end

      add_swagger_documentation format: :json
    end
  end

  subject do
    get '/0.1/swagger_doc.json'
    JSON.parse(last_response.body)
  end

  it 'uses build name as operationId' do
    expect(subject['paths']['/0.1/simple_opp']['get']['operationId']).to eql('get01SimpleOpp')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grape-swagger-0.26.1 spec/swagger_v2/operation_id_api_spec.rb
grape-swagger-0.26.0 spec/swagger_v2/operation_id_api_spec.rb
grape-swagger-0.25.3 spec/swagger_v2/operation_id_api_spec.rb