swagger-docs 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/swagger/docs/dsl.rb +2 -2
- data/lib/swagger/docs/version.rb +1 -1
- data/spec/lib/swagger/docs/dsl_spec.rb +5 -3
- data/spec/lib/swagger/docs/generator_spec.rb +0 -2
- data/swagger-docs.gemspec +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8825dc5f25eba5d598ba46750cacffc9ef02323a
|
|
4
|
+
data.tar.gz: c5d933b4eff9eaeb938dfd60dd652b6a3c02dbe2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1d3d4f181c1561d0c9bac1b9c4e018811f4d3361d9a96035084748ebcddf58276b27c2b4bd122f1ab350b5d76aedf26fb1643f44efd781d652c3f82f48bfe71
|
|
7
|
+
data.tar.gz: 8500d83f450776b2f077570ee4759618f34c8ce6da394feb8d87ab9ded7c7ab6cd65dd7df47b3e285403cc41019e5119cd28e5956f3a437b65a4f83c91904f32
|
data/CHANGELOG.md
CHANGED
data/lib/swagger/docs/dsl.rb
CHANGED
|
@@ -62,7 +62,7 @@ module Swagger
|
|
|
62
62
|
|
|
63
63
|
def response(status, text = nil, model = nil)
|
|
64
64
|
if status.is_a? Symbol
|
|
65
|
-
status
|
|
65
|
+
status = :ok if status == :success
|
|
66
66
|
status_code = Rack::Utils.status_code(status)
|
|
67
67
|
response_messages << {:code => status_code, :responseModel => model, :message => text || status.to_s.titleize}
|
|
68
68
|
else
|
|
@@ -108,7 +108,7 @@ module Swagger
|
|
|
108
108
|
}.merge!(hash)
|
|
109
109
|
self.required << name if required == :required
|
|
110
110
|
end
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
# helper method to generate enums
|
|
113
113
|
def property_list(name, type, required, description = nil, allowed_values = [], hash = {})
|
|
114
114
|
hash.merge!({allowable_values: {value_type: "LIST", values: allowed_values}})
|
data/lib/swagger/docs/version.rb
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe Swagger::Docs::SwaggerDSL do
|
|
4
|
-
|
|
5
4
|
subject { described_class.new() }
|
|
6
5
|
|
|
7
6
|
describe "#response" do
|
|
@@ -9,7 +8,10 @@ describe Swagger::Docs::SwaggerDSL do
|
|
|
9
8
|
subject.response(:ok, "Some sample text", "Tag")
|
|
10
9
|
expect(subject.response_messages).to eq([{:code=>200, :responseModel=>"Tag", :message=>"Some sample text"}])
|
|
11
10
|
end
|
|
12
|
-
end
|
|
13
11
|
|
|
12
|
+
it "accept :success was an :ok status" do
|
|
13
|
+
subject.response(:success, "Some sample text", "Tag")
|
|
14
|
+
expect(subject.response_messages).to eq([{:code=>200, :responseModel=>"Tag", :message=>"Some sample text"}])
|
|
15
|
+
end
|
|
16
|
+
end
|
|
14
17
|
end
|
|
15
|
-
|
|
@@ -5,8 +5,6 @@ describe Swagger::Docs::Generator do
|
|
|
5
5
|
require "fixtures/controllers/application_controller"
|
|
6
6
|
require "fixtures/controllers/ignored_controller"
|
|
7
7
|
|
|
8
|
-
class FooParentController; end
|
|
9
|
-
|
|
10
8
|
before(:each) do
|
|
11
9
|
FileUtils.rm_rf(tmp_dir)
|
|
12
10
|
stub_const('ActionController::Base', ApplicationController)
|
data/swagger-docs.gemspec
CHANGED
|
@@ -9,8 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Rich Hollis"]
|
|
10
10
|
spec.email = ["richhollis@gmail.com"]
|
|
11
11
|
spec.description = %q{Generates json files for rails apps to use with swagger-ui}
|
|
12
|
-
spec.summary = %q{Generates swagger-ui json files for rails apps with APIs. You add the swagger DSL to your controller classes and then run one rake task to generate the json files.
|
|
13
|
-
}
|
|
12
|
+
spec.summary = %q{Generates swagger-ui json files for rails apps with APIs. You add the swagger DSL to your controller classes and then run one rake task to generate the json files.}
|
|
14
13
|
spec.homepage = "https://github.com/richhollis/swagger-docs"
|
|
15
14
|
spec.license = "MIT"
|
|
16
15
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: swagger-docs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rich Hollis
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|