openapi_validator 0.1.0 → 0.2.0
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 +4 -4
- data/README.md +9 -1
- data/lib/openapi_validator/request_validator.rb +6 -2
- data/lib/openapi_validator/version.rb +1 -1
- metadata +5 -14
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -7
- data/Gemfile +0 -4
- data/Gemfile.lock +0 -41
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/openapi_validator.gemspec +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0a2e54a665eba19186fb3b7ca15dfe8707cf38ba121ac7f0ebcc956715f9dd87
|
|
4
|
+
data.tar.gz: ddea6b70d0f33c09a81c39025621b9075c836e15d1dda0b066485f4602f70af3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 36f5c80aa8a9252c34581de7963df8e318a84c3b5de85910bf5843f7d446b806c428e485b77dedfe2fef82395c84aecb454905e9fa964337bc81b8ce60c890b3
|
|
7
|
+
data.tar.gz: 212fba9b212eb55990d91ac0ae739d8cc0745427414eb41a144601124709df80f844b74d3fccdd6e2dd230bc426688542185d4c536ed2c0b175acf085aaacb23
|
data/README.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
[gem]: https://rubygems.org/gems/openapi_validator
|
|
2
|
+
[travis]: https://travis-ci.org/llcmedsolutions/openapi_validator
|
|
3
|
+
[codeclimate]: https://codeclimate.com/github/llcmedsolutions/openapi_validator
|
|
4
|
+
|
|
5
|
+
# openapi_validator
|
|
6
|
+
[][gem]
|
|
7
|
+
[][travis]
|
|
8
|
+
[][codeclimate]
|
|
9
|
+
[][codeclimate]
|
|
2
10
|
|
|
3
11
|
Validator used for [openapi_rspec](https://github.com/llcmedsolutions/openapi_rspec)
|
|
4
12
|
|
|
@@ -16,8 +16,12 @@ module OpenapiValidator
|
|
|
16
16
|
self
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def validate_response(
|
|
20
|
-
|
|
19
|
+
def validate_response(body:, code:)
|
|
20
|
+
response_body = body
|
|
21
|
+
response_code = code.to_s
|
|
22
|
+
if @code != response_code
|
|
23
|
+
@errors << "Path #{path} did not respond with expected status code. Expected #{@code} got #{response_code}"
|
|
24
|
+
end
|
|
21
25
|
@errors += JSON::Validator.fully_validate(api_doc, response_body, fragment: fragment)
|
|
22
26
|
self
|
|
23
27
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openapi_validator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Svyatoslav Kryukov
|
|
8
8
|
autorequire:
|
|
9
|
-
bindir:
|
|
9
|
+
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-04-
|
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json-schema
|
|
@@ -73,16 +73,8 @@ executables: []
|
|
|
73
73
|
extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
|
75
75
|
files:
|
|
76
|
-
- ".gitignore"
|
|
77
|
-
- ".rspec"
|
|
78
|
-
- ".travis.yml"
|
|
79
|
-
- Gemfile
|
|
80
|
-
- Gemfile.lock
|
|
81
76
|
- LICENSE.txt
|
|
82
77
|
- README.md
|
|
83
|
-
- Rakefile
|
|
84
|
-
- bin/console
|
|
85
|
-
- bin/setup
|
|
86
78
|
- data/openapi-3.0.json
|
|
87
79
|
- lib/openapi_validator.rb
|
|
88
80
|
- lib/openapi_validator/documentation_validator.rb
|
|
@@ -92,7 +84,6 @@ files:
|
|
|
92
84
|
- lib/openapi_validator/request_validator.rb
|
|
93
85
|
- lib/openapi_validator/validator.rb
|
|
94
86
|
- lib/openapi_validator/version.rb
|
|
95
|
-
- openapi_validator.gemspec
|
|
96
87
|
homepage: https://github.com/llcmedsolutions/openapi_validator
|
|
97
88
|
licenses:
|
|
98
89
|
- MIT
|
|
@@ -105,14 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
105
96
|
requirements:
|
|
106
97
|
- - ">="
|
|
107
98
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: '
|
|
99
|
+
version: '2.4'
|
|
109
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
101
|
requirements:
|
|
111
102
|
- - ">="
|
|
112
103
|
- !ruby/object:Gem::Version
|
|
113
104
|
version: '0'
|
|
114
105
|
requirements: []
|
|
115
|
-
rubygems_version: 3.0.
|
|
106
|
+
rubygems_version: 3.0.3
|
|
116
107
|
signing_key:
|
|
117
108
|
specification_version: 4
|
|
118
109
|
summary: Validator used for openapi_rspec
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
openapi_validator (0.1.0)
|
|
5
|
-
json-schema (~> 2.8)
|
|
6
|
-
|
|
7
|
-
GEM
|
|
8
|
-
remote: https://rubygems.org/
|
|
9
|
-
specs:
|
|
10
|
-
addressable (2.6.0)
|
|
11
|
-
public_suffix (>= 2.0.2, < 4.0)
|
|
12
|
-
diff-lcs (1.3)
|
|
13
|
-
json-schema (2.8.1)
|
|
14
|
-
addressable (>= 2.4)
|
|
15
|
-
public_suffix (3.0.3)
|
|
16
|
-
rake (10.5.0)
|
|
17
|
-
rspec (3.8.0)
|
|
18
|
-
rspec-core (~> 3.8.0)
|
|
19
|
-
rspec-expectations (~> 3.8.0)
|
|
20
|
-
rspec-mocks (~> 3.8.0)
|
|
21
|
-
rspec-core (3.8.0)
|
|
22
|
-
rspec-support (~> 3.8.0)
|
|
23
|
-
rspec-expectations (3.8.2)
|
|
24
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
25
|
-
rspec-support (~> 3.8.0)
|
|
26
|
-
rspec-mocks (3.8.0)
|
|
27
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
28
|
-
rspec-support (~> 3.8.0)
|
|
29
|
-
rspec-support (3.8.0)
|
|
30
|
-
|
|
31
|
-
PLATFORMS
|
|
32
|
-
ruby
|
|
33
|
-
|
|
34
|
-
DEPENDENCIES
|
|
35
|
-
bundler (~> 2.0)
|
|
36
|
-
openapi_validator!
|
|
37
|
-
rake (~> 10.0)
|
|
38
|
-
rspec (~> 3.0)
|
|
39
|
-
|
|
40
|
-
BUNDLED WITH
|
|
41
|
-
2.0.1
|
data/Rakefile
DELETED
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "openapi_validator"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/openapi_validator.gemspec
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
lib = File.expand_path("../lib", __FILE__)
|
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
-
require "openapi_validator/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = "openapi_validator"
|
|
7
|
-
spec.version = OpenapiValidator::VERSION
|
|
8
|
-
spec.authors = ["Svyatoslav Kryukov"]
|
|
9
|
-
spec.email = ["s.g.kryukov@yandex.ru"]
|
|
10
|
-
|
|
11
|
-
spec.summary = "Validator used for openapi_rspec"
|
|
12
|
-
spec.homepage = "https://github.com/llcmedsolutions/openapi_validator"
|
|
13
|
-
spec.license = "MIT"
|
|
14
|
-
|
|
15
|
-
# Specify which files should be added to the gem when it is released.
|
|
16
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
17
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
18
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
19
|
-
end
|
|
20
|
-
spec.bindir = "exe"
|
|
21
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
|
-
spec.require_paths = ["lib"]
|
|
23
|
-
|
|
24
|
-
spec.add_runtime_dependency "json-schema", "~> 2.8"
|
|
25
|
-
|
|
26
|
-
spec.add_development_dependency "bundler", "~> 2.0"
|
|
27
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
|
28
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
|
29
|
-
end
|