Skip to content
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

Make default schemes undefined to match Swagger Spec #382

Merged
merged 1 commit into from
Apr 14, 2016
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion lib/grape-swagger/doc_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def defaults
{
info: {},
models: [],
schemes: %w( https http ),
api_version: 'v1',
target_class: nil,
mount_path: '/swagger_doc',
Expand Down
1 change: 0 additions & 1 deletion spec/support/api_swagger_v2_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"=>{
Expand Down
3 changes: 0 additions & 3 deletions spec/swagger_v2/api_swagger_v2_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"=>{
Expand Down Expand Up @@ -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"=>{
Expand Down Expand Up @@ -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"=>{
Expand Down
2 changes: 0 additions & 2 deletions spec/swagger_v2/default_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"=>{
Expand Down Expand Up @@ -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"=>{
Expand Down
3 changes: 0 additions & 3 deletions spec/swagger_v2/hide_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"=>{
Expand Down Expand Up @@ -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"=>{
Expand All @@ -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"=>{
Expand Down
2 changes: 0 additions & 2 deletions spec/swagger_v2/mounted_target_class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"=>{
Expand All @@ -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"=>{
Expand Down
3 changes: 0 additions & 3 deletions spec/swagger_v2/simple_mounted_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"=>{
Expand Down Expand Up @@ -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"=>{
Expand All @@ -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"=>{
Expand Down