Sha256: cdc325290ebb93566aa53a8060e88be265723c2241f1d6938662033a5ffb0546

Contents?: true

Size: 723 Bytes

Versions: 29

Compression:

Stored size: 723 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe 'definitions/models' do
  include_context "#{MODEL_PARSER} swagger example"

  before :all do
    module TheApi
      class ModelApi < Grape::API
        format :json

        add_swagger_documentation models: [
          ::Entities::UseResponse,
          ::Entities::ApiError,
          ::Entities::RecursiveModel,
          ::Entities::DocumentedHashAndArrayModel
        ]
      end
    end
  end

  def app
    TheApi::ModelApi
  end

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

  specify do
    expect(subject).to include 'definitions'
    expect(subject['definitions']).to include(swagger_definitions_models)
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
grape-swagger-1.6.1 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.6.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
gitlab-grape-swagger-1.5.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.5.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.4.2 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.4.1 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.4.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.3.1 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.3.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.2.1 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.2.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.1.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-1.0.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-0.34.2 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-0.34.1 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-0.34.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-0.33.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-0.32.1 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-0.32.0 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
grape-swagger-0.31.1 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb