openapi_first 2.0.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/openapi_first/configuration.rb +1 -1
- data/lib/openapi_first/test.rb +13 -5
- data/lib/openapi_first/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87fceda33e397fa75a8268144e5cbacfb802333a5ef1c315676d14458312b01b
|
4
|
+
data.tar.gz: a734ee73e2dce89fea8d2fc93c713b0505923b2b2098b560a2b44ef3e5753c84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63d51c543d3d689ced06170e1e53f6d0a20056af2643e1f1fccfbf966b14352c55ad9c0dfd92478ceb7e5aaac0b6f7c7563e17d9e69ab2f924f6a9d4846c45ff
|
7
|
+
data.tar.gz: 8649d5737439a2414802e17ed562a0efdf294f29e7515b0e248e5736cd59235eba876baf52aad8e5d602ff90ba5afc8902ed1609d902dfe03c65d4136afc1042
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,13 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
-
## 2.0
|
5
|
+
## 2.0.2
|
6
|
+
|
7
|
+
- Fix setting custom error response (thanks @gobijan)
|
8
|
+
|
9
|
+
## 2.0.1 (Janked)
|
10
|
+
|
11
|
+
## 2.0.0
|
6
12
|
|
7
13
|
### New Features
|
8
14
|
- Test Assertions! 📋 You can now use `assert_api_conform` for contract testing in your rack-test / Rails integration tests. See Readme for details.
|
data/lib/openapi_first/test.rb
CHANGED
@@ -5,15 +5,23 @@ require_relative 'test/methods'
|
|
5
5
|
module OpenapiFirst
|
6
6
|
# Test integration
|
7
7
|
module Test
|
8
|
+
class NotRegisteredError < StandardError; end
|
9
|
+
|
10
|
+
DEFINITIONS = {}.freeze
|
11
|
+
def self.definitions = DEFINITIONS
|
12
|
+
|
8
13
|
def self.register(path, as: :default)
|
9
|
-
|
10
|
-
@registry[as] = OpenapiFirst.load(path)
|
14
|
+
definitions[as] = OpenapiFirst.load(path)
|
11
15
|
end
|
12
16
|
|
13
17
|
def self.[](api)
|
14
|
-
|
15
|
-
|
16
|
-
|
18
|
+
definitions.fetch(api) do
|
19
|
+
option = api == :default ? '' : ", as: #{api.inspect}"
|
20
|
+
raise(NotRegisteredError,
|
21
|
+
"API description '#{api.inspect}' not found." \
|
22
|
+
"Please call OpenapiFirst::Test.register('myopenapi.yaml'#{option}) " \
|
23
|
+
'once before calling assert_api_conform.')
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapi_first
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Haller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hana
|