Skip to content

require grape first #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Next Release
* [#211](https://github.com/tim-vandecasteele/grape-swagger/pull/211): Fixed the dependency, just `require 'grape'` - [@u2](https://github.com/u2).
* [#210](https://github.com/tim-vandecasteele/grape-swagger/pull/210): Fixed the range `:values` option, now exposed as `enum` parameters - [@u2](https://github.com/u2).
* [#208](https://github.com/tim-vandecasteele/grape-swagger/pull/208): Fixed `Float` parameters, exposed as Swagger `float` types - [@u2](https://github.com/u2).
* [#196](https://github.com/tim-vandecasteele/grape-swagger/pull/196): If `:type` is omitted, see if it's available in `:using` - [@jhollinger](https://github.com/jhollinger).
Expand Down
2 changes: 1 addition & 1 deletion lib/grape-swagger.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'grape'
require 'grape-swagger/version'
require 'grape-swagger/errors'
require 'grape-swagger/markdown'
Expand Down Expand Up @@ -248,7 +249,6 @@ def parse_entity_models(models)
end

properties[property_name] = p

end

result[name] = {
Expand Down
2 changes: 0 additions & 2 deletions spec/api_global_models_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'Global Models' do

before :all do
module Entities
module Some
Expand Down Expand Up @@ -74,6 +73,5 @@ def app
'created_at' => { 'type' => 'dateTime', 'description' => 'Creation of something.' }
}
})

end
end
3 changes: 0 additions & 3 deletions spec/api_models_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'API Models' do

before :all do
module Entities
class Something < Grape::Entity
Expand Down Expand Up @@ -98,7 +97,6 @@ def app

desc 'This tests the enum values in params and documentation.', entity: Entities::EnumValues, params: Entities::EnumValues.documentation
get '/enum_description_in_entity' do

enum_value = OpenStruct.new gender: 'Male', number: 1

present enum_value, with: Entities::EnumValues
Expand Down Expand Up @@ -226,7 +224,6 @@ def app
],
'type' => 'EnumValues'
)

end

it 'includes referenced models in those with aliased references.' do
Expand Down
3 changes: 0 additions & 3 deletions spec/api_paths_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'simple api with prefix' do

before :all do
class ApiWithPrefix < Grape::API
prefix :api
Expand All @@ -16,7 +15,6 @@ class SimpleApiWithPrefix < Grape::API
mount ApiWithPrefix
add_swagger_documentation
end

end

def app
Expand Down Expand Up @@ -63,5 +61,4 @@ def app
)
end
end

end
1 change: 0 additions & 1 deletion spec/api_root_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'simple root api' do

before :all do
class ApiRoot < Grape::API
format :json
Expand Down
4 changes: 0 additions & 4 deletions spec/grape-swagger_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'helpers' do

before :all do
class HelperTestAPI < Grape::API
end
Expand Down Expand Up @@ -59,7 +58,6 @@ class HelperTestAPI < Grape::API
allowMultiple: false
}
]

end

it 'parses symbol param as string' do
Expand Down Expand Up @@ -97,7 +95,6 @@ class CustomType
]
end
end

end

context 'parsing the path' do
Expand Down Expand Up @@ -139,5 +136,4 @@ class CustomType
]
end
end

end
1 change: 0 additions & 1 deletion spec/markdown/kramdown_adapter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe GrapeSwagger::Markdown::KramdownAdapter do

context 'initialization' do
it 'uses GFM as default input and disable coderay' do
adapter = GrapeSwagger::Markdown::KramdownAdapter.new
Expand Down
1 change: 0 additions & 1 deletion spec/markdown/redcarpet_adapter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe GrapeSwagger::Markdown::RedcarpetAdapter, unless: RUBY_PLATFORM.eql?('java') do

context 'initialization' do
context 'initialization' do
it 'uses fenced_code_blocks, auto_links and rouge as default.' do
Expand Down
5 changes: 0 additions & 5 deletions spec/non_default_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
describe 'options: ' do
context 'overriding the basepath' do
before :all do

class BasePathMountedApi < Grape::API
desc 'This gets something.'
get '/something' do
Expand All @@ -17,7 +16,6 @@ class SimpleApiWithBasePath < Grape::API
mount BasePathMountedApi
add_swagger_documentation base_path: NON_DEFAULT_BASE_PATH
end

end

def app
Expand Down Expand Up @@ -254,7 +252,6 @@ class PrefixedApiWithHiddenDocumentation < Grape::API
mount HideDocumentationPathPrefixedMountedApi
add_swagger_documentation hide_documentation_path: true
end

end

def app
Expand Down Expand Up @@ -286,7 +283,6 @@ def app
}]
)
end

end

context 'overriding hiding the documentation paths in prefixed and versioned API' do
Expand Down Expand Up @@ -338,7 +334,6 @@ def app
}]
)
end

end

context 'overriding the mount-path' do
Expand Down
1 change: 0 additions & 1 deletion spec/range_values_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ def app
{ 'paramType' => 'form', 'name' => 'number', 'description' => nil, 'type' => 'integer', 'required' => true, 'allowMultiple' => false, 'format' => 'int32', 'enum' => (-5..5).to_a }
]
end

end