openapi_contracts 0.9.0 → 0.9.1

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: 6a6d176876364825de3b5e11746a49add3125a4511003e24002f8dda270347d6
4
- data.tar.gz: 468ebb8a26dadc72b3f0d9fdb0e9a2f8a39b2e94418c555926fe0b12d0ea0b8a
3
+ metadata.gz: 989040d95a13df9bd1c3138c908071ff04593a4de03422e13ae4262dd6414cdb
4
+ data.tar.gz: 1d5202b6e194132c185ed6476e169b4678dbc9e234225c30de65cf2decbeb53b
5
5
  SHA512:
6
- metadata.gz: c310ffa9c64a85d3cef12f2e2fa685ae52f0bfeff975ab63a1532f88be964dc2acd577b24f4a70017efb0bc4b19c0a522a56b9660686ba33c89d970959ca1690
7
- data.tar.gz: 1a2293a48671a21d6f6915162c1240fa56b719e2d40947b8e46782635c6cc6cd7d4e26ee6012f7360b098d1ab04bf82f282e090fb373d9e1e9ddb982a6672dce
6
+ metadata.gz: 8c4f45d3aa218538737b24630b952fe90c91d824063b2a18573d681809edb6766d28dc0d3503f126b204d48a92ee7120d83f1f73c96dfc94df678d282e275f08
7
+ data.tar.gz: 2782dbc72660c32caf5dc8b23d7719df2b1176c2cb2c7feeef838f54f6e306ef3574abb836b26ee66c25f5f8e394f1462d660712f56de90ab37f0aac1e873990
@@ -13,7 +13,7 @@ module OpenapiContracts
13
13
  def request_body
14
14
  return @request_body if instance_variable_defined?(:@request_body)
15
15
 
16
- @request_body = @spec.navigate('requestBody')&.then { |s| Doc::Request.new(s) }
16
+ @request_body = @spec.navigate('requestBody').presence&.then { |s| Doc::Request.new(s) }
17
17
  end
18
18
 
19
19
  def responses
@@ -57,7 +57,8 @@ module OpenapiContracts
57
57
  pointer.to_json_schemer_pointer
58
58
  end
59
59
 
60
- delegate :dig, :fetch, :keys, :key?, :[], :to_h, to: :resolve
60
+ delegate :dig, to: :resolve, allow_nil: true
61
+ delegate :fetch, :keys, :key?, :[], :to_h, to: :resolve
61
62
 
62
63
  def at_pointer(pointer)
63
64
  self.class.new(raw, pointer)
@@ -67,6 +68,10 @@ module OpenapiContracts
67
68
  @raw['openapi']&.then { |v| Gem::Version.new(v) }
68
69
  end
69
70
 
71
+ def presence
72
+ resolve.present? ? self : nil
73
+ end
74
+
70
75
  # Returns the actual sub-specification contents at the pointer of this Specification
71
76
  def resolve
72
77
  @pointer.walk(@raw)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openapi_contracts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mkon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-03 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -92,28 +92,28 @@ dependencies:
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 1.54.1
95
+ version: 1.55.1
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 1.54.1
102
+ version: 1.55.1
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rubocop-rspec
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 2.22.0
109
+ version: 2.23.0
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - '='
115
115
  - !ruby/object:Gem::Version
116
- version: 2.22.0
116
+ version: 2.23.0
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: simplecov
119
119
  requirement: !ruby/object:Gem::Requirement