rspec-openapi 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/rspec/openapi/schema_merger.rb +8 -4
- data/lib/rspec/openapi/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: 78fd09cf0ef8419c47bd5b9f8f225260b83f700fcfcb23a2515c50e341832961
|
4
|
+
data.tar.gz: f1895433af3d0a5ee6b065f1e4bbc92bdd4707749480a95b307b685132206bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae459f44e0471afec512959b999b47fa23b3144efd9272d140a47af6a65ec4f40c234b1f317d197610952263225e247505f8febca1901fe094ebd74b5c8e27b4
|
7
|
+
data.tar.gz: a74f8c5a3121ecbff640c40eccd0f420ae2869b676fdb592411c13e7fddfbfb13fd31c96b9d1ea1e73578c9007c3e78f34dda9bcb820ae4f67b9db5d209fbad7
|
data/CHANGELOG.md
CHANGED
@@ -21,9 +21,12 @@ class << RSpec::OpenAPI::SchemaMerger = Object.new
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
# Not doing `base.replace(deep_merge(base, spec))` to preserve key orders
|
24
|
+
# Not doing `base.replace(deep_merge(base, spec))` to preserve key orders.
|
25
|
+
# Also this needs to be aware of OpenAPI details unlike an ordinary deep_reverse_merge
|
26
|
+
# because a Hash-like structure may be an array whose Hash elements have a key name.
|
27
|
+
#
|
25
28
|
# TODO: Perform more intelligent merges like rerouting edits / merging types
|
26
|
-
# Should we probably force-merge `summary` regardless of manual modifications?
|
29
|
+
# TODO: Should we probably force-merge `summary` regardless of manual modifications?
|
27
30
|
def deep_reverse_merge!(base, spec)
|
28
31
|
spec.each do |key, value|
|
29
32
|
if base[key].is_a?(Hash) && value.is_a?(Hash)
|
@@ -31,9 +34,10 @@ class << RSpec::OpenAPI::SchemaMerger = Object.new
|
|
31
34
|
elsif !base.key?(key)
|
32
35
|
base[key] = value
|
33
36
|
elsif base[key].is_a?(Array) && value.is_a?(Array)
|
34
|
-
if
|
35
|
-
|
37
|
+
# parameters need to be merged as if `name` and `in` were the Hash keys.
|
38
|
+
if key == 'parameters'
|
36
39
|
base[key] |= value
|
40
|
+
base[key].uniq! { |param| param.slice('name', 'in') }
|
37
41
|
end
|
38
42
|
else
|
39
43
|
# no-op
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-openapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|