openapi_validator 0.1.0 → 0.2.0

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: 822e3bc70b1809c2ac07cdde19399631aa6ff7f17210cf254bf7b567dd68633f
4
- data.tar.gz: d274a51ea8c4bb5ef61357402168518a6601fe1ba41779e1119e520703cbfed2
3
+ metadata.gz: 0a2e54a665eba19186fb3b7ca15dfe8707cf38ba121ac7f0ebcc956715f9dd87
4
+ data.tar.gz: ddea6b70d0f33c09a81c39025621b9075c836e15d1dda0b066485f4602f70af3
5
5
  SHA512:
6
- metadata.gz: a8e28dca08cb8d1dee75db18dab8753cfec98cb997b8abc6f6508b40990bc78618af4ac33a680edc9a5ea2e858d38f9c859b112d876b0513f49ab03bb23c14f9
7
- data.tar.gz: c9e7a6b794fcb8b7477881114a12146c325ac72876543d40e9efb9fb6de0edb8cce73762250a67959af5d8388bf4d69da80ce62de325a0c2c4d40fdc9d84d680
6
+ metadata.gz: 36f5c80aa8a9252c34581de7963df8e318a84c3b5de85910bf5843f7d446b806c428e485b77dedfe2fef82395c84aecb454905e9fa964337bc81b8ce60c890b3
7
+ data.tar.gz: 212fba9b212eb55990d91ac0ae739d8cc0745427414eb41a144601124709df80f844b74d3fccdd6e2dd230bc426688542185d4c536ed2c0b175acf085aaacb23
data/README.md CHANGED
@@ -1,4 +1,12 @@
1
- # OpenapiValidator
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 Version](https://badge.fury.io/rb/openapi_validator.svg)][gem]
7
+ [![Build Status](https://travis-ci.org/llcmedsolutions/openapi_validator.svg?branch=master)][travis]
8
+ [![Code Climate](https://codeclimate.com/github/llcmedsolutions/openapi_validator/badges/gpa.svg)][codeclimate]
9
+ [![Test Coverage](https://codeclimate.com/github/llcmedsolutions/openapi_validator/badges/coverage.svg)][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(response_body)
20
- @response_body = response_body
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
@@ -1,3 +1,3 @@
1
1
  module OpenapiValidator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svyatoslav Kryukov
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-09 00:00:00.000000000 Z
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: '0'
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.1
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
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.1
7
- before_install: gem install bundler -v 2.0.1
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in openapi_validator.gemspec
4
- gemspec
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
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task default: :spec
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
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -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