swagger-docs 0.1.2 → 0.1.3
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/swagger/docs/generator.rb +4 -3
- data/lib/swagger/docs/version.rb +1 -1
- data/spec/lib/swagger/docs/generator_spec.rb +2 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fae3be7ad414552f11679fa9038c9bdadc8e313a
|
4
|
+
data.tar.gz: d669dca205c935dcd57af4b405fe5e777cd014ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c6cc1f82349ef06372e0443312f7abd7e154942b35631f4176b450e841d3b83c905e396d665d22c7874aa244c8dd5b1422b9451e8f2c6de84a9a04243b05b9c
|
7
|
+
data.tar.gz: fd41c0368dc912c349bcf58ab3e286b6b3506a4295afcb5fda9e8452e13851cf048ad8ddd28b489dcdf20ca47645a3dd673f2edfc116b167c465e97300e42cf8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -102,9 +102,10 @@ module Swagger
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def process_path(path, root, config, settings)
|
105
|
-
return {action:
|
106
|
-
klass = "#{path.to_s.camelize}Controller".constantize
|
107
|
-
return {action: :skipped, path: path
|
105
|
+
return {action: :skipped, reason: :empty_path} if path.empty?
|
106
|
+
klass = "#{path.to_s.camelize}Controller".constantize rescue nil
|
107
|
+
return {action: :skipped, path: path, reason: :klass_not_present} if !klass
|
108
|
+
return {action: :skipped, path: path, reason: :not_swagger_resource} if !klass.methods.include?(:swagger_config) or !klass.swagger_config[:controller]
|
108
109
|
apis, models = [], {}
|
109
110
|
Config.base_application.routes.routes.select{|i| i.defaults[:controller] == path}.each do |route|
|
110
111
|
ret = get_route_path_apis(path, route, klass, settings, config)
|
data/lib/swagger/docs/version.rb
CHANGED
@@ -18,7 +18,8 @@ describe Swagger::Docs::Generator do
|
|
18
18
|
stub_route("^GET$", "show", "api/v1/sample", "/api/v1/sample/:id(.:format)"),
|
19
19
|
stub_route("^PUT$", "update", "api/v1/sample", "/api/v1/sample/:id(.:format)"),
|
20
20
|
stub_route("^DELETE$", "destroy", "api/v1/sample", "/api/v1/sample/:id(.:format)"),
|
21
|
-
stub_route("^GET$", "new", "api/v1/sample", "/api/v1/sample/new(.:format)") # no parameters for this method
|
21
|
+
stub_route("^GET$", "new", "api/v1/sample", "/api/v1/sample/new(.:format)"), # no parameters for this method
|
22
|
+
stub_route("^GET$", "index", "", "/api/v1/empty_path") # intentional empty path should not cause any errors
|
22
23
|
]}
|
23
24
|
|
24
25
|
let(:tmp_dir) { Pathname.new('/tmp/swagger-docs/') }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger-docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rich Hollis
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
RYcsqDfanYBx7QcftOnbeQq7/Ep7Zx+W9+Ph3TiJLMLdAr7bLkgN1SjvrjTL5mQR
|
31
31
|
FuQtYvE4LKiUQpG7vLTRB78dQBlSj9fnv2OM9w==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-04-
|
33
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: bundler
|
metadata.gz.sig
CHANGED
Binary file
|