diff --git a/CHANGELOG.md b/CHANGELOG.md index d9526f5d..9503dee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### (next) + +#### Fixes +* [#382](https://github.com/ruby-grape/grape-swagger/pull/382): Make the schemes undefined by default to match Swagger 2.0 spec indicating that a blank schemes will use the scheme from the document - [@wleeper](https://github.com/wleeper). + ### 0.20.0 / 2016-04-09 #### Features diff --git a/lib/grape-swagger/doc_methods.rb b/lib/grape-swagger/doc_methods.rb index 96c70cd4..19d4446f 100644 --- a/lib/grape-swagger/doc_methods.rb +++ b/lib/grape-swagger/doc_methods.rb @@ -90,7 +90,6 @@ def defaults { info: {}, models: [], - schemes: %w( https http ), api_version: 'v1', target_class: nil, mount_path: '/swagger_doc', diff --git a/spec/support/api_swagger_v2_result.rb b/spec/support/api_swagger_v2_result.rb index 064210df..c5d362dd 100644 --- a/spec/support/api_swagger_v2_result.rb +++ b/spec/support/api_swagger_v2_result.rb @@ -79,7 +79,6 @@ class ApiError < Grape::Entity {"name"=>"thing2", "description"=>"Operations about thing2s"}, {"name"=>"dummy", "description"=>"Operations about dummies"} ], - "schemes"=>["https", "http"], "paths"=>{ "/v3/other_thing/{elements}"=>{ "get"=>{ diff --git a/spec/swagger_v2/api_swagger_v2_response_spec.rb b/spec/swagger_v2/api_swagger_v2_response_spec.rb index c07d2856..b8c4f797 100644 --- a/spec/swagger_v2/api_swagger_v2_response_spec.rb +++ b/spec/swagger_v2/api_swagger_v2_response_spec.rb @@ -55,7 +55,6 @@ def app {"name"=>"entity_response", "description"=>"Operations about entity_responses"}, {"name"=>"nested_type", "description"=>"Operations about nested_types"} ], - "schemes"=>["https", "http"], "paths"=>{ "/nested_type"=>{ "get"=>{ @@ -104,7 +103,6 @@ def app {"name"=>"entity_response", "description"=>"Operations about entity_responses"}, {"name"=>"nested_type", "description"=>"Operations about nested_types"} ], - "schemes"=>["https", "http"], "paths"=>{ "/entity_response"=>{ "get"=>{ @@ -150,7 +148,6 @@ def app {"name"=>"entity_response", "description"=>"Operations about entity_responses"}, {"name"=>"nested_type", "description"=>"Operations about nested_types"} ], - "schemes"=>["https", "http"], "paths"=>{ "/params_response"=>{ "post"=>{ diff --git a/spec/swagger_v2/default_api_spec.rb b/spec/swagger_v2/default_api_spec.rb index 4c4a48e2..6c659525 100644 --- a/spec/swagger_v2/default_api_spec.rb +++ b/spec/swagger_v2/default_api_spec.rb @@ -27,7 +27,6 @@ def app "produces"=>["application/json"], "host"=>"example.org", "tags" => [{"name"=>"something", "description"=>"Operations about somethings"}], - "schemes" => ["https", "http"], "paths"=>{ "/something"=>{ "get"=>{ @@ -72,7 +71,6 @@ def app "produces"=>["application/json"], "host"=>"example.org", "tags" => [{"name"=>"something", "description"=>"Operations about somethings"}], - "schemes" => ["https", "http"], "paths"=>{ "/something"=>{ "get"=>{ diff --git a/spec/swagger_v2/hide_api_spec.rb b/spec/swagger_v2/hide_api_spec.rb index 2934f85d..a4475a12 100644 --- a/spec/swagger_v2/hide_api_spec.rb +++ b/spec/swagger_v2/hide_api_spec.rb @@ -41,7 +41,6 @@ def app "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", "tags" => [{"name"=>"simple", "description"=>"Operations about simples"}, {"name"=>"lazy", "description"=>"Operations about lazies"}], - "schemes" => ["https", "http"], "paths"=>{ "/simple"=>{ "get"=>{ @@ -98,7 +97,6 @@ def app "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", "tags" => [{"name"=>"simple", "description"=>"Operations about simples"}], - "schemes" => ["https", "http"], "paths"=>{ "/simple/show"=>{ "get"=>{ @@ -117,7 +115,6 @@ def app "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", "tags" => [{"name"=>"simple", "description"=>"Operations about simples"}], - "schemes" => ["https", "http"], "paths"=>{ "/simple/show"=>{ "get"=>{ diff --git a/spec/swagger_v2/mounted_target_class_spec.rb b/spec/swagger_v2/mounted_target_class_spec.rb index d50e1a8f..fe8296bd 100644 --- a/spec/swagger_v2/mounted_target_class_spec.rb +++ b/spec/swagger_v2/mounted_target_class_spec.rb @@ -34,7 +34,6 @@ def app "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", "tags"=>[{"name"=>"simple", "description"=>"Operations about simples"}], - "schemes"=>["https", "http"], "paths"=>{ "/simple"=>{ "get"=>{ @@ -57,7 +56,6 @@ def app "tags" => [{"name"=>"simple", "description"=>"Operations about simples"}], "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", - "schemes" => ["https", "http"], "paths" => { "/simple"=>{ "get"=>{ diff --git a/spec/swagger_v2/simple_mounted_api_spec.rb b/spec/swagger_v2/simple_mounted_api_spec.rb index abb41673..8d438969 100644 --- a/spec/swagger_v2/simple_mounted_api_spec.rb +++ b/spec/swagger_v2/simple_mounted_api_spec.rb @@ -79,7 +79,6 @@ def app "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", "tags" => [{"name"=>"simple", "description"=>"Operations about simples"}, {"name"=>"simple-test", "description"=>"Operations about simple-tests"}, {"name"=>"simple_with_headers", "description"=>"Operations about simple_with_headers"}, {"name"=>"items", "description"=>"Operations about items"}, {"name"=>"custom", "description"=>"Operations about customs"}], - "schemes"=>["https", "http"], "paths"=>{ "/simple"=>{ "get"=>{ @@ -155,7 +154,6 @@ def app "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", "tags" => [{"name"=>"simple", "description"=>"Operations about simples"}, {"name"=>"simple-test", "description"=>"Operations about simple-tests"}, {"name"=>"simple_with_headers", "description"=>"Operations about simple_with_headers"}, {"name"=>"items", "description"=>"Operations about items"}, {"name"=>"custom", "description"=>"Operations about customs"}], - "schemes"=>["https", "http"], "paths"=>{ "/simple"=>{ "get"=>{ @@ -182,7 +180,6 @@ def app "produces"=>["application/xml", "application/json", "application/octet-stream", "text/plain"], "host"=>"example.org", "tags" => [{"name"=>"simple", "description"=>"Operations about simples"}, {"name"=>"simple-test", "description"=>"Operations about simple-tests"}, {"name"=>"simple_with_headers", "description"=>"Operations about simple_with_headers"}, {"name"=>"items", "description"=>"Operations about items"}, {"name"=>"custom", "description"=>"Operations about customs"}], - "schemes"=>["https", "http"], "paths"=>{ "/simple-test"=>{ "get"=>{