openapi_contracts 0.13.0 → 0.13.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: 2e3c770fbbdd4c6d8a18f69f9deaf65959ce70088232ad8291a5aa10bf4b6f0e
4
- data.tar.gz: 2248125b3e18a71d403f72b25eae01c2173628f0c58deaf7e004d501cb7f9b16
3
+ metadata.gz: a6ead386a672bc6da357f0686b6de4fd01e9c7a7155b65e312b04975f138a76f
4
+ data.tar.gz: cea44722316b8bb3d2bbb85f47a4794b8cdb3f143ff8cf8d65ad9a262d546127
5
5
  SHA512:
6
- metadata.gz: 64d09afded34921b66bd12573998906882681cf68e62c277abb1f569afa3da93e856240877e9edffa1768c14d7a9766de0a9be57bf9f40a0b443c366187f8813
7
- data.tar.gz: 3b93196eaaf631d853d693a6082b19399b2db334190cd0bc7d8d27d80ddf67260556249f284c515fb6c0bf207d9d6599a916a2bfbccdbb4c40d6637ae08004fd
6
+ metadata.gz: 13b0e8e63dfe4e1459d9fcca05bd82b017465ce180b4680b2a9f7464ffbef837e89810f3ba5be1b484f41619694a97bcac814787d81361be6a1c94bd96851728
7
+ data.tar.gz: 2b20b1298db18a1846f677569e7a4eb257672a6f138c0d156dbd2caf7b70097469f4baf8c9a138bf07ff68355c25dd9e7547b86d24705259b2bd1ec4435d6982
@@ -35,20 +35,20 @@ module OpenapiContracts
35
35
  end
36
36
 
37
37
  # Returns an Enumerator over all Operations
38
- def operations(&block) # rubocop:disable Naming/BlockForwarding
38
+ def operations(&block)
39
39
  return enum_for(:operations) unless block_given?
40
40
 
41
41
  paths.each do |path|
42
- path.operations.each(&block) # rubocop:disable Naming/BlockForwarding
42
+ path.operations.each(&block)
43
43
  end
44
44
  end
45
45
 
46
46
  # Returns an Enumerator over all Responses
47
- def responses(&block) # rubocop:disable Naming/BlockForwarding
47
+ def responses(&block)
48
48
  return enum_for(:responses) unless block_given?
49
49
 
50
50
  operations.each do |operation|
51
- operation.responses.each(&block) # rubocop:disable Naming/BlockForwarding
51
+ operation.responses.each(&block)
52
52
  end
53
53
  end
54
54
 
@@ -30,7 +30,7 @@ module OpenapiContracts
30
30
  # file list consists of
31
31
  # - root file
32
32
  # - all files in components/
33
- # - all path files referenced by the root file
33
+ # - all path & webhook files referenced by the root file
34
34
  def build_file_list
35
35
  list = {@rootfile.relative_path_from(@cwd) => Doc::Pointer[]}
36
36
  Dir[File.expand_path('components/**/*.yaml', @cwd)].each do |file|
@@ -38,16 +38,21 @@ module OpenapiContracts
38
38
  pointer = Doc::Pointer.from_path pathname.sub_ext('')
39
39
  list.merge! pathname => pointer
40
40
  end
41
- YAML.safe_load_file(@rootfile).fetch('paths') { {} }.each_pair do |k, v|
42
- next unless v['$ref'] && !v['$ref'].start_with?('#')
41
+ rootdata = YAML.safe_load_file(@rootfile)
42
+ %w(paths webhooks).each do |name|
43
+ rootdata.fetch(name) { {} }.each_pair do |k, v|
44
+ next unless v['$ref'] && !v['$ref'].start_with?('#')
43
45
 
44
- list.merge! Pathname(v['$ref']).cleanpath => Doc::Pointer['paths', k]
46
+ list.merge! Pathname(v['$ref']).cleanpath => Doc::Pointer[name, k]
47
+ end
45
48
  end
46
49
  list
47
50
  end
48
51
 
49
52
  def file_to_data(pathname, pointer)
50
53
  YAML.safe_load_file(@cwd.join(pathname)).tap do |data|
54
+ break {} unless data.present?
55
+
51
56
  transform_objects!(data, pathname.parent, pointer)
52
57
  end
53
58
  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.13.0
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mkon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -84,42 +84,42 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 3.12.0
87
+ version: 3.13.0
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: 3.12.0
94
+ version: 3.13.0
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rubocop
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - '='
100
100
  - !ruby/object:Gem::Version
101
- version: 1.59.0
101
+ version: 1.60.2
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - '='
107
107
  - !ruby/object:Gem::Version
108
- version: 1.59.0
108
+ version: 1.60.2
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: rubocop-rspec
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - '='
114
114
  - !ruby/object:Gem::Version
115
- version: 2.25.0
115
+ version: 2.26.1
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - '='
121
121
  - !ruby/object:Gem::Version
122
- version: 2.25.0
122
+ version: 2.26.1
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: simplecov
125
125
  requirement: !ruby/object:Gem::Requirement
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubygems_version: 3.4.22
199
+ rubygems_version: 3.4.6
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Openapi schemas as API contracts