swagger-core 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/swagger.rb +1 -1
- data/lib/swagger/api.rb +1 -1
- data/lib/swagger/attachable.rb +6 -6
- data/lib/swagger/v2/operation.rb +1 -1
- data/lib/swagger/version.rb +1 -1
- data/swagger-core.gemspec +2 -2
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5aba9b5a68451390562512924f4c3d9c67ef8e88
|
4
|
+
data.tar.gz: e2861be404cf83fd74102030b6fd80015459d908
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a1b56875724d0abf2c28153988927db270dbcd412ed7b0ef63ae5c9775f42cced19068b16f35c3b60febb6d277a303ca43aad3227dd22ab83ab6990630e61ee
|
7
|
+
data.tar.gz: 704dc9cc3df5f300a1afb1f099afc73897d1bce5dbde8b77a8a1eae5ca0e0add0a02093882806a4355b2b17b3a58c3011501bcf7b6ee907f35d34bdaa81ec5a0
|
data/lib/swagger.rb
CHANGED
@@ -21,7 +21,7 @@ module Swagger
|
|
21
21
|
def self.build(content, opts = {})
|
22
22
|
parser ||= Swagger::Parsers.parser_for(opts[:format])
|
23
23
|
content = parser.parse(content) unless parser.nil?
|
24
|
-
Swagger::API.
|
24
|
+
Swagger::API.build_api(content)
|
25
25
|
end
|
26
26
|
|
27
27
|
# Load a Swagger document from a file.
|
data/lib/swagger/api.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Swagger
|
2
2
|
# A common interface for building or loading Swagger documents of any version. See subclasses.
|
3
3
|
class API < SwaggerObject
|
4
|
-
def self.
|
4
|
+
def self.build_api(hash)
|
5
5
|
version = hash['swaggerVersion'] || hash['swagger']
|
6
6
|
major, _minor = version.to_s.split('.')
|
7
7
|
case major
|
data/lib/swagger/attachable.rb
CHANGED
@@ -15,15 +15,15 @@ module Swagger
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# @api private
|
18
|
-
def attach_to_children
|
19
|
-
each_value do |v|
|
20
|
-
if v.respond_to? :attach_parent
|
21
|
-
|
22
|
-
elsif v.respond_to? :each_value
|
18
|
+
def attach_to_children
|
19
|
+
each_value do |v| # rubocop:disable Style/Next
|
20
|
+
v.attach_parent self if v.respond_to? :attach_parent
|
21
|
+
if v.respond_to? :each_value
|
23
22
|
v.each_value do |sv|
|
24
23
|
sv.attach_parent self if sv.respond_to? :attach_parent
|
25
24
|
end
|
26
|
-
|
25
|
+
end
|
26
|
+
if v.respond_to? :each
|
27
27
|
v.each do |sv|
|
28
28
|
sv.attach_parent self if sv.respond_to? :attach_parent
|
29
29
|
end
|
data/lib/swagger/v2/operation.rb
CHANGED
@@ -42,7 +42,7 @@ module Swagger
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def default_response
|
45
|
-
return nil if responses.values.nil?
|
45
|
+
return nil if responses.nil? || responses.values.nil?
|
46
46
|
|
47
47
|
# FIXME: Swagger isn't very clear on "normal response codes"
|
48
48
|
# In the examples, default is actually an error
|
data/lib/swagger/version.rb
CHANGED
data/swagger-core.gemspec
CHANGED
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
23
|
spec.add_dependency 'addressable', '~> 2.3'
|
24
|
-
spec.add_dependency 'hashie', '~> 3.0'
|
24
|
+
spec.add_dependency 'hashie', '~> 3.0', '< 3.4.0'
|
25
25
|
spec.add_dependency 'json-schema', '~> 2.2'
|
26
26
|
spec.add_dependency 'mime-types', '~> 2.0'
|
27
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
28
28
|
spec.add_development_dependency 'rake'
|
29
29
|
spec.add_development_dependency 'rspec'
|
30
30
|
spec.add_development_dependency 'rubocop'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Lincoln
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -31,6 +31,9 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 3.4.0
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +41,9 @@ dependencies:
|
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '3.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.4.0
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: json-schema
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +78,14 @@ dependencies:
|
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
81
|
+
version: '1.5'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
88
|
+
version: '1.5'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: rake
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|