rswag-specs 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea0b695d0762fd3d465ded216a3227852396ee711121bc75599695c1cf1a0f7b
|
4
|
+
data.tar.gz: 4c297a6f19905c8be024616aa4ac480482097e3c9c4bb491a25fc1747d2bec9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 887dea23d1f139a17c35f38398ade4aaa6b7de86d89cb1f917d675717d96c403e173e31080fa8370a00515dfb1c26bdba71a362c48d6a7d8e03d78d6680f71df
|
7
|
+
data.tar.gz: 331518551742470b3e017daee643f54785f559bf9f8a5cb3edb4a705833dc1989a107223f5fc54ad2b2656ac1004468e34498986c0b564f63bbc67b123963250
|
@@ -4,10 +4,10 @@ RSpec.configure do |config|
|
|
4
4
|
# Specify a root folder where Swagger JSON files are generated
|
5
5
|
# NOTE: If you're using the rswag-api to serve API descriptions, you'll need
|
6
6
|
# to ensure that it's configured to serve Swagger from the same folder
|
7
|
-
config.swagger_root = Rails.root.
|
7
|
+
config.swagger_root = Rails.root.join('swagger').to_s
|
8
8
|
|
9
9
|
# Define one or more Swagger documents and provide global metadata for each one
|
10
|
-
# When you run the 'rswag:specs:
|
10
|
+
# When you run the 'rswag:specs:swaggerize' rake task, the complete Swagger will
|
11
11
|
# be generated at the provided relative path under swagger_root
|
12
12
|
# By default, the operations defined in spec files are added to the first
|
13
13
|
# document below. You can override this behavior by adding a swagger_doc tag to the
|
@@ -14,17 +14,19 @@ module Rswag
|
|
14
14
|
def validate!(metadata, response)
|
15
15
|
swagger_doc = @config.get_swagger_doc(metadata[:swagger_doc])
|
16
16
|
|
17
|
-
validate_code!(metadata, response
|
17
|
+
validate_code!(metadata, response)
|
18
18
|
validate_headers!(metadata, response.headers)
|
19
19
|
validate_body!(metadata, swagger_doc, response.body)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def validate_code!(metadata,
|
24
|
+
def validate_code!(metadata, response)
|
25
25
|
expected = metadata[:response][:code].to_s
|
26
|
-
if code != expected
|
27
|
-
raise UnexpectedResponse,
|
26
|
+
if response.code != expected
|
27
|
+
raise UnexpectedResponse,
|
28
|
+
"Expected response code '#{response.code}' to match '#{expected}'\n" \
|
29
|
+
"Response body: #{response.body}"
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rswag-specs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richie Morris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '3.1'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '6.
|
22
|
+
version: '6.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '3.1'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '6.
|
32
|
+
version: '6.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: railties
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '3.1'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '6.
|
42
|
+
version: '6.1'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '3.1'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '6.
|
52
|
+
version: '6.1'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: json-schema
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|