mini-apivore 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/mini_apivore.rb +2 -2
- data/lib/mini_apivore/swagger_checker.rb +6 -3
- data/lib/mini_apivore/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d85e7dd24101374365786adc9d1ce7a9469f363d
|
4
|
+
data.tar.gz: f8bcddf844b25c03a5ee142b456be5c4e7547bbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18f366be86dce400f03e53cef246c58e3a65df998e2c72ca8b3fb603cdf01dcf8ff64a8f6e90db3567a1b76ed3e8c783b98bf6c247a7c05f72e2e8b1bcf212f3
|
7
|
+
data.tar.gz: 6ce510195a00e5337cdda680983a0372d9cc11260ba7fac39fd2f1711149b1b8d8db82ff7e835a126a3993643b9da81a77713af2184e81e51409bd38bb032812
|
data/lib/mini_apivore.rb
CHANGED
@@ -34,8 +34,8 @@ module MiniApivore
|
|
34
34
|
#---- class methods -----------
|
35
35
|
module ClassMethods
|
36
36
|
|
37
|
-
def init_swagger( swagger_path )
|
38
|
-
SWAGGER_CHECKERS[self] ||= MiniApivore::SwaggerChecker.instance_for(swagger_path)
|
37
|
+
def init_swagger( swagger_path, schema= '' )
|
38
|
+
SWAGGER_CHECKERS[self] ||= MiniApivore::SwaggerChecker.instance_for(swagger_path, schema)
|
39
39
|
end
|
40
40
|
|
41
41
|
def runnable_methods
|
@@ -4,8 +4,8 @@ module MiniApivore
|
|
4
4
|
class SwaggerChecker
|
5
5
|
PATH_TO_CHECKER_MAP = {}
|
6
6
|
|
7
|
-
def self.instance_for(path)
|
8
|
-
PATH_TO_CHECKER_MAP[path] ||= new(path)
|
7
|
+
def self.instance_for(path, schema = '' )
|
8
|
+
PATH_TO_CHECKER_MAP[path] ||= new(path, schema)
|
9
9
|
end
|
10
10
|
|
11
11
|
def has_path?(path)
|
@@ -64,8 +64,9 @@ module MiniApivore
|
|
64
64
|
|
65
65
|
attr_reader :mappings
|
66
66
|
|
67
|
-
def initialize(swagger_path)
|
67
|
+
def initialize(swagger_path, schema )
|
68
68
|
@swagger_path = swagger_path
|
69
|
+
@schema = schema
|
69
70
|
load_swagger_doc!
|
70
71
|
validate_swagger!
|
71
72
|
setup_mappings!
|
@@ -77,6 +78,8 @@ module MiniApivore
|
|
77
78
|
end
|
78
79
|
|
79
80
|
def fetch_swagger!
|
81
|
+
return @schema unless @schema.empty?
|
82
|
+
|
80
83
|
if File.exist?( swagger_path )
|
81
84
|
JSON.parse( File.read(swagger_path) )
|
82
85
|
else
|
data/lib/mini_apivore/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini-apivore
|
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
|
- alekseyl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|
@@ -80,8 +80,8 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '10.3'
|
83
|
-
description: "
|
84
|
-
schema "
|
83
|
+
description: " Minitest adaptation of apivore gem,\n Provides
|
84
|
+
a tool for testing your application api against your swagger schema "
|
85
85
|
email:
|
86
86
|
- leshchuk@gmail.com
|
87
87
|
executables: []
|