openapi_contracts 0.4.1 → 0.4.2

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: f218118990cd1c4d1d2933bcb42a84a84492226a1a075d2cb92a5acd026b3478
4
- data.tar.gz: 072bf7fd56d4a22adacb31706e8773888588e3e466b9783653065a335de4a063
3
+ metadata.gz: c495a3bb1abc5e8a6da67fc5ed5dc7a9ba98a42ebd84d5f80bc7665cb5badded
4
+ data.tar.gz: bcfc21e9c2b09c02f32a6e9eec7644a7790b94ac7c92a25c4aa54a55a46d307b
5
5
  SHA512:
6
- metadata.gz: 54e760ebff2c63b357bad2f47b1ad741405fbe23997af447079361e377cda3419d7befa4717cc193e0f7f11fe56ce719dc93c3dc198e70b9257b30b3d8e3e1db
7
- data.tar.gz: b706d606ec874409f5b1cdae4dd3b166b036cbc009f4d288f423cfae870c4db8d58e5751ebc38607e7b1349b189c4441bb78256d349a9739653966c7490b751c
6
+ metadata.gz: d82aab412b36a2669556e69b0cdbec4f793076b4757050ad1b6b943856446f66e01d2b17f0d296e521fc04d39ebbfd83e481d1341de1c18290044d4baed0fd0c
7
+ data.tar.gz: 6fd2334e58fc53fd75b41c1ba9df2dd2a4da2925920c9ffcf2562df3f01b03e66e5801f88fbb691d5b73225ba9817bc1e42d89846f2b15ecaffa5a0e126e6b17
@@ -1,7 +1,7 @@
1
1
  module OpenapiContracts
2
2
  class Doc::Response
3
3
  def initialize(schema)
4
- @schema = schema
4
+ @schema = schema.follow_refs
5
5
  end
6
6
 
7
7
  def headers
@@ -7,6 +7,14 @@ module OpenapiContracts
7
7
  @path = path.freeze
8
8
  end
9
9
 
10
+ def follow_refs
11
+ if (ref = dig('$ref'))
12
+ at_path(ref.split('/')[1..])
13
+ else
14
+ self
15
+ end
16
+ end
17
+
10
18
  def fragment
11
19
  path.map { |p| p.gsub('/', '~1') }.join('/').then { |s| "#/#{s}" }
12
20
  end
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mkon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-02 00:00:00.000000000 Z
11
+ date: 2022-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: 1.29.1
81
+ version: 1.30.1
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: 1.29.1
88
+ version: 1.30.1
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: rubocop-rspec
91
91
  requirement: !ruby/object:Gem::Requirement