apivore 1.1.0 → 1.1.1
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 +8 -8
- data/lib/apivore/all_routes_tested_validator.rb +1 -1
- data/lib/apivore/swagger_checker.rb +12 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWNkMmU5NWZlZTdhODdhOGM0ZjlmYmRkZWM3OGQ3YjllNjViZDVhNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzgzNTI1MWM1NDc2ZDMxYThkMzYyZGI1NjIwODFiZmFhMzg3ZjgxZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGQ1Mjg1NWE4YmJhY2M4MjRkOWIxM2UyNzZhOTM5NmZjODkxNTdjM2FhNTA5
|
10
|
+
MWQ2ZGVmNjZmYjViZTM5MDljZGI0OWM1ZGQ0OTY2ZGZmNjkxNDI5NDllYjdj
|
11
|
+
OTU1NjI1M2YyMzg4MjUxMzNjOTM1MjFhODhjNWRkYjc3MmNhMDk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2I5Y2FlM2YyZGYzNTMyMzQwMTQ3NDkxMzRiOTQ5ZTJmNmUxNzYzNTZhNTMx
|
14
|
+
ZGE2MjJhNzUxODliYzQzMTAyNGI4OGRiOWYxODVmY2I4NjYwNGMzZDM4YTgx
|
15
|
+
ZDBkZjQ2MDdkNmVkMTRlYzllOWY5ZGU0N2VmYzk0ZDdiYWMxNzQ=
|
@@ -3,7 +3,7 @@ module Apivore
|
|
3
3
|
|
4
4
|
def matches?(swagger_checker)
|
5
5
|
@errors = []
|
6
|
-
swagger_checker.
|
6
|
+
swagger_checker.untested_mappings.each do |path, methods|
|
7
7
|
methods.each do |method, codes|
|
8
8
|
codes.each do |code, _|
|
9
9
|
@errors << "#{method} #{path} is untested for response code #{code}"
|
@@ -29,11 +29,13 @@ module Apivore
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def remove_tested_end_point_response(path, method, code)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
return if untested_mappings[path].nil? ||
|
33
|
+
untested_mappings[path][method].nil?
|
34
|
+
untested_mappings[path][method].delete(code.to_s)
|
35
|
+
if untested_mappings[path][method].size == 0
|
36
|
+
untested_mappings[path].delete(method)
|
37
|
+
if untested_mappings[path].size == 0
|
38
|
+
untested_mappings.delete(path)
|
37
39
|
end
|
38
40
|
end
|
39
41
|
end
|
@@ -42,10 +44,12 @@ module Apivore
|
|
42
44
|
@swagger.base_path
|
43
45
|
end
|
44
46
|
|
45
|
-
attr_reader :swagger_path, :
|
47
|
+
attr_reader :swagger_path, :untested_mappings, :swagger
|
46
48
|
|
47
49
|
private
|
48
50
|
|
51
|
+
attr_reader :mappings
|
52
|
+
|
49
53
|
def initialize(swagger_path)
|
50
54
|
@swagger_path = swagger_path
|
51
55
|
load_swagger_doc!
|
@@ -84,6 +88,8 @@ module Apivore
|
|
84
88
|
raise "duplicate" unless @mappings[path][method][response_code].nil?
|
85
89
|
@mappings[path][method][response_code] = fragment
|
86
90
|
end
|
91
|
+
|
92
|
+
@untested_mappings = JSON.parse(JSON.generate(@mappings))
|
87
93
|
end
|
88
94
|
end
|
89
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apivore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Horn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|