rails-swagger 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails/swagger.rb +0 -1
- data/lib/rails/swagger/controller.rb +1 -1
- data/lib/rails/swagger/router.rb +2 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60dcbcd8c29a1f62409b5a74ada9fe10156d81d3
|
4
|
+
data.tar.gz: 78f746f92e9e12c8b6bd8f5c1f2149d3a4efadfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35344fdc0cc7b480c0f30759657acce83f284b6a3e945be64bb1b4b6010501d0407ba2ed808603d89f0a9d8f724ec44ca9d8a7221b34086f75c7fbd28f7e7461
|
7
|
+
data.tar.gz: 8734547b54976c568bcf36b14c953395943487d6e019a19567c7bbbe1dda14756879965068954110373536c9486462a69249bacda519aed5914fe62d527fb552
|
data/lib/rails/swagger.rb
CHANGED
@@ -20,7 +20,7 @@ module Rails
|
|
20
20
|
# the current request.
|
21
21
|
def swagger_endpoint
|
22
22
|
key = "#{params[:controller]}##{params[:action]}"
|
23
|
-
|
23
|
+
swagger_engine.endpoints[key]
|
24
24
|
end
|
25
25
|
|
26
26
|
# Validates request parameters against the Swagger API spec
|
data/lib/rails/swagger/router.rb
CHANGED
@@ -9,7 +9,7 @@ module Rails
|
|
9
9
|
end
|
10
10
|
# Translates path params from {bracket} syntax to :symbol syntax
|
11
11
|
def path
|
12
|
-
self[:url].gsub
|
12
|
+
self[:url].gsub(/\{(.+)\}/, ':\\1')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -41,7 +41,7 @@ module Rails
|
|
41
41
|
# Adds an individual endpoint to the routing tree
|
42
42
|
def << route
|
43
43
|
raise "Argument must be an Endpoint" unless Endpoint === route
|
44
|
-
|
44
|
+
_base, *subroute = route[:_path].split '/' # Split out first element
|
45
45
|
if subroute.count == 0
|
46
46
|
route[:_path] = ""
|
47
47
|
@endpoints << route
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-swagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenaniah Cerny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: json-schema
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|