openapi_first 1.3.0 → 1.3.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: caea1ca3e63935e0d04a52bade49e9f8270da3bdcf3b3cb89e3791cc202c1a79
4
- data.tar.gz: 3d1da5e269e0328ec383b30cf29486b1d49aa91317e428626c26f9284eb1d55c
3
+ metadata.gz: f7e9e0bad95211ba2b4f103089abc40d0e7fc46a24f7ce8e57318ba489655637
4
+ data.tar.gz: f1d28fbaa79a4eb7e00b242eb9bd89a78789bbb04742e0b87501ac454fb1cf47
5
5
  SHA512:
6
- metadata.gz: 0a48588e004db687e0dee2b54982837aebe3dcb3d65cf3191141b59d7f63d945083dd0bc364346acaa4442420101310ffc174383ee6e2897468b6680f90c4172
7
- data.tar.gz: 352789bc86107fc3253cb08a3771399e5ecee50189c119903bc678f1de7eb078a6bc89a797bc22322ae52beb3de30c64de612fb6350d572cc6a6a1c1cb6fd067
6
+ metadata.gz: f225e3a49d7f582e0f82822b2c9acbcd6008b6cc2464971e1485ef75ec12e508effc2165b6afc91535e27bc9bb9004f92fb160218f7295b0f45c3f58946ed616
7
+ data.tar.gz: 4c6ef209df4816361bed148f33b4e55ace50a5481172913c5760d014b09247adf74ffdbd2422ae930cd889494fe941c20d492835863d52a9dde67a75c1bd8622
@@ -17,9 +17,6 @@ module OpenapiFirst
17
17
  def_delegators :operation_object,
18
18
  :[]
19
19
 
20
- WRITE_METHODS = Set.new(%w[post put patch delete]).freeze
21
- private_constant :WRITE_METHODS
22
-
23
20
  def initialize(path, request_method, path_item_object, openapi_version:)
24
21
  @path = path
25
22
  @method = request_method
@@ -56,6 +53,7 @@ module OpenapiFirst
56
53
  # Checks if the operation is a write operation.
57
54
  # This is the case for POST, PUT, PATCH and DELETE request methods.
58
55
  # @return [Boolean] `true` if the operation is a write operation, `false` otherwise.
56
+ # @deprecated Use {#write?} instead.
59
57
  def write?
60
58
  WRITE_METHODS.include?(method)
61
59
  end
@@ -158,8 +156,10 @@ module OpenapiFirst
158
156
  private
159
157
 
160
158
  WRITE_METHODS = Set.new(%w[post put patch delete]).freeze
159
+ private_constant :WRITE_METHODS
161
160
 
162
161
  IGNORED_HEADERS = Set['Content-Type', 'Accept', 'Authorization'].freeze
162
+ private_constant :IGNORED_HEADERS
163
163
 
164
164
  def all_parameters
165
165
  @all_parameters ||= (@path_item_object.fetch('parameters', []) + operation_object.fetch('parameters', []))
@@ -37,7 +37,7 @@ module OpenapiFirst
37
37
  schema_object = media_type['schema']
38
38
  next unless schema_object
39
39
 
40
- result[type] = Schema.new(schema_object, write: @operation.write?,
40
+ result[type] = Schema.new(schema_object, write: true,
41
41
  openapi_version: @operation.openapi_version)
42
42
  end
43
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenapiFirst
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  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: 1.3.0
4
+ version: 1.3.1
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-01-28 00:00:00.000000000 Z
11
+ date: 2024-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_refs