patch_ruby 1.9.0 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -2
- data/Gemfile.lock +40 -44
- data/Makefile +2 -2
- data/lib/patch_ruby/api/estimates_api.rb +33 -25
- data/lib/patch_ruby/api/orders_api.rb +21 -16
- data/lib/patch_ruby/api/preferences_api.rb +17 -13
- data/lib/patch_ruby/api/projects_api.rb +9 -7
- data/lib/patch_ruby/api_client.rb +51 -49
- data/lib/patch_ruby/api_error.rb +1 -1
- data/lib/patch_ruby/configuration.rb +38 -9
- data/lib/patch_ruby/models/allocation.rb +21 -11
- data/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +25 -19
- data/lib/patch_ruby/models/create_ethereum_estimate_request.rb +26 -21
- data/lib/patch_ruby/models/create_flight_estimate_request.rb +323 -0
- data/lib/patch_ruby/models/create_mass_estimate_request.rb +22 -13
- data/lib/patch_ruby/models/create_order_request.rb +21 -11
- data/lib/patch_ruby/models/create_preference_request.rb +21 -11
- data/lib/patch_ruby/models/create_shipping_estimate_request.rb +371 -0
- data/lib/patch_ruby/models/create_success_response.rb +247 -0
- data/lib/patch_ruby/models/create_vehicle_estimate_request.rb +326 -0
- data/lib/patch_ruby/models/error_response.rb +22 -13
- data/lib/patch_ruby/models/estimate.rb +22 -13
- data/lib/patch_ruby/models/estimate_list_response.rb +22 -13
- data/lib/patch_ruby/models/estimate_response.rb +22 -13
- data/lib/patch_ruby/models/meta_index_object.rb +23 -15
- data/lib/patch_ruby/models/order.rb +23 -15
- data/lib/patch_ruby/models/order_list_response.rb +22 -13
- data/lib/patch_ruby/models/order_response.rb +22 -13
- data/lib/patch_ruby/models/photo.rb +21 -11
- data/lib/patch_ruby/models/preference.rb +21 -11
- data/lib/patch_ruby/models/preference_list_response.rb +22 -13
- data/lib/patch_ruby/models/preference_response.rb +22 -13
- data/lib/patch_ruby/models/project.rb +24 -17
- data/lib/patch_ruby/models/project_list_response.rb +22 -13
- data/lib/patch_ruby/models/project_response.rb +22 -13
- data/lib/patch_ruby/models/sdg.rb +21 -11
- data/lib/patch_ruby/models/standard.rb +21 -11
- data/lib/patch_ruby/version.rb +2 -2
- data/lib/patch_ruby.rb +5 -1
- data/patch_ruby.gemspec +8 -3
- data/spec/api_client_spec.rb +34 -13
- data/spec/configuration_spec.rb +1 -1
- data/spec/integration/estimates_spec.rb +17 -1
- data/spec/integration/preferences_spec.rb +1 -1
- data/spec/models/create_mass_estimate_request_spec.rb +1 -1
- data/spec/models/error_response_spec.rb +1 -1
- data/spec/models/estimate_list_response_spec.rb +1 -1
- data/spec/models/estimate_response_spec.rb +1 -1
- data/spec/models/estimate_spec.rb +1 -1
- data/spec/models/meta_index_object_spec.rb +1 -1
- data/spec/models/order_list_response_spec.rb +1 -1
- data/spec/models/order_response_spec.rb +1 -1
- data/spec/models/order_spec.rb +1 -1
- data/spec/models/preference_list_response_spec.rb +1 -1
- data/spec/models/preference_response_spec.rb +1 -1
- data/spec/models/project_list_response_spec.rb +1 -1
- data/spec/models/project_response_spec.rb +1 -1
- data/spec/models/project_spec.rb +1 -1
- data/spec/spec_helper.rb +69 -61
- metadata +56 -58
- data/lib/patch_ruby/.api_client.rb.un~ +0 -0
- data/lib/patch_ruby/.configuration.rb.un~ +0 -0
- data/lib/patch_ruby/.version.rb.un~ +0 -0
- data/lib/patch_ruby/api/.orders_api.rb.un~ +0 -0
- data/lib/patch_ruby/models/.create_ethereum_estimate_request.rb.un~ +0 -0
- data/spec/.spec_helper.rb.un~ +0 -0
- data/spec/integration/.estimates_spec.rb.un~ +0 -0
- data/spec/integration/.orders_spec.rb.un~ +0 -0
- data/spec/integration/.preferences_spec.rb.un~ +0 -0
- data/spec/integration/.projects_spec.rb.un~ +0 -0
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
Contact: developers@usepatch.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Patch
|
16
17
|
class PreferenceListResponse
|
@@ -32,6 +33,11 @@ module Patch
|
|
32
33
|
}
|
33
34
|
end
|
34
35
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
35
41
|
# Attribute type mapping.
|
36
42
|
def self.openapi_types
|
37
43
|
{
|
@@ -42,15 +48,14 @@ module Patch
|
|
42
48
|
}
|
43
49
|
end
|
44
50
|
|
45
|
-
#
|
51
|
+
# List of attributes with nullable: true
|
46
52
|
def self.openapi_nullable
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
nullable_properties
|
53
|
+
Set.new([
|
54
|
+
:'error',
|
55
|
+
])
|
52
56
|
end
|
53
57
|
|
58
|
+
|
54
59
|
# Allows models with corresponding API classes to delegate API operations to those API classes
|
55
60
|
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
|
56
61
|
# Eg. Order.create_order delegates to OrdersApi.new.create_order
|
@@ -160,7 +165,9 @@ module Patch
|
|
160
165
|
def build_from_hash(attributes)
|
161
166
|
return nil unless attributes.is_a?(Hash)
|
162
167
|
self.class.openapi_types.each_pair do |key, type|
|
163
|
-
if
|
168
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
169
|
+
self.send("#{key}=", nil)
|
170
|
+
elsif type =~ /\AArray<(.*)>/i
|
164
171
|
# check to ensure the input is an array given that the attribute
|
165
172
|
# is documented as an array but the input is not
|
166
173
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -168,7 +175,7 @@ module Patch
|
|
168
175
|
end
|
169
176
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
170
177
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
171
|
-
end
|
178
|
+
end
|
172
179
|
end
|
173
180
|
|
174
181
|
self
|
@@ -180,8 +187,8 @@ module Patch
|
|
180
187
|
# @return [Object] Deserialized data
|
181
188
|
def _deserialize(type, value)
|
182
189
|
case type.to_sym
|
183
|
-
when :
|
184
|
-
|
190
|
+
when :Time
|
191
|
+
Time.parse(value)
|
185
192
|
when :Date
|
186
193
|
Date.parse(value)
|
187
194
|
when :String
|
@@ -211,7 +218,9 @@ module Patch
|
|
211
218
|
end
|
212
219
|
end
|
213
220
|
else # model
|
214
|
-
|
221
|
+
# models (e.g. Pet) or oneOf
|
222
|
+
klass = Patch.const_get(type)
|
223
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
215
224
|
end
|
216
225
|
end
|
217
226
|
|
@@ -237,7 +246,7 @@ module Patch
|
|
237
246
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
238
247
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
239
248
|
end
|
240
|
-
|
249
|
+
|
241
250
|
hash[param] = _to_hash(value)
|
242
251
|
end
|
243
252
|
hash
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
Contact: developers@usepatch.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Patch
|
16
17
|
class PreferenceResponse
|
@@ -29,6 +30,11 @@ module Patch
|
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
32
38
|
# Attribute type mapping.
|
33
39
|
def self.openapi_types
|
34
40
|
{
|
@@ -38,15 +44,14 @@ module Patch
|
|
38
44
|
}
|
39
45
|
end
|
40
46
|
|
41
|
-
#
|
47
|
+
# List of attributes with nullable: true
|
42
48
|
def self.openapi_nullable
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
nullable_properties
|
49
|
+
Set.new([
|
50
|
+
:'error',
|
51
|
+
])
|
48
52
|
end
|
49
53
|
|
54
|
+
|
50
55
|
# Allows models with corresponding API classes to delegate API operations to those API classes
|
51
56
|
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
|
52
57
|
# Eg. Order.create_order delegates to OrdersApi.new.create_order
|
@@ -144,7 +149,9 @@ module Patch
|
|
144
149
|
def build_from_hash(attributes)
|
145
150
|
return nil unless attributes.is_a?(Hash)
|
146
151
|
self.class.openapi_types.each_pair do |key, type|
|
147
|
-
if
|
152
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
153
|
+
self.send("#{key}=", nil)
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
148
155
|
# check to ensure the input is an array given that the attribute
|
149
156
|
# is documented as an array but the input is not
|
150
157
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -152,7 +159,7 @@ module Patch
|
|
152
159
|
end
|
153
160
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
161
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
155
|
-
end
|
162
|
+
end
|
156
163
|
end
|
157
164
|
|
158
165
|
self
|
@@ -164,8 +171,8 @@ module Patch
|
|
164
171
|
# @return [Object] Deserialized data
|
165
172
|
def _deserialize(type, value)
|
166
173
|
case type.to_sym
|
167
|
-
when :
|
168
|
-
|
174
|
+
when :Time
|
175
|
+
Time.parse(value)
|
169
176
|
when :Date
|
170
177
|
Date.parse(value)
|
171
178
|
when :String
|
@@ -195,7 +202,9 @@ module Patch
|
|
195
202
|
end
|
196
203
|
end
|
197
204
|
else # model
|
198
|
-
|
205
|
+
# models (e.g. Pet) or oneOf
|
206
|
+
klass = Patch.const_get(type)
|
207
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
199
208
|
end
|
200
209
|
end
|
201
210
|
|
@@ -221,7 +230,7 @@ module Patch
|
|
221
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
222
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
223
232
|
end
|
224
|
-
|
233
|
+
|
225
234
|
hash[param] = _to_hash(value)
|
226
235
|
end
|
227
236
|
hash
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
Contact: developers@usepatch.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Patch
|
16
17
|
class Project
|
@@ -90,6 +91,11 @@ module Patch
|
|
90
91
|
}
|
91
92
|
end
|
92
93
|
|
94
|
+
# Returns all the JSON keys this model knows about
|
95
|
+
def self.acceptable_attributes
|
96
|
+
attribute_map.values
|
97
|
+
end
|
98
|
+
|
93
99
|
# Attribute type mapping.
|
94
100
|
def self.openapi_types
|
95
101
|
{
|
@@ -108,19 +114,16 @@ module Patch
|
|
108
114
|
}
|
109
115
|
end
|
110
116
|
|
111
|
-
#
|
117
|
+
# List of attributes with nullable: true
|
112
118
|
def self.openapi_nullable
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
nullable_properties.add("sdgs")
|
120
|
-
|
121
|
-
nullable_properties
|
119
|
+
Set.new([
|
120
|
+
:'photos',
|
121
|
+
:'standard',
|
122
|
+
:'sdgs'
|
123
|
+
])
|
122
124
|
end
|
123
125
|
|
126
|
+
|
124
127
|
# Allows models with corresponding API classes to delegate API operations to those API classes
|
125
128
|
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
|
126
129
|
# Eg. Order.create_order delegates to OrdersApi.new.create_order
|
@@ -309,7 +312,9 @@ module Patch
|
|
309
312
|
def build_from_hash(attributes)
|
310
313
|
return nil unless attributes.is_a?(Hash)
|
311
314
|
self.class.openapi_types.each_pair do |key, type|
|
312
|
-
if
|
315
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
316
|
+
self.send("#{key}=", nil)
|
317
|
+
elsif type =~ /\AArray<(.*)>/i
|
313
318
|
# check to ensure the input is an array given that the attribute
|
314
319
|
# is documented as an array but the input is not
|
315
320
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -317,7 +322,7 @@ module Patch
|
|
317
322
|
end
|
318
323
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
319
324
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
320
|
-
end
|
325
|
+
end
|
321
326
|
end
|
322
327
|
|
323
328
|
self
|
@@ -329,8 +334,8 @@ module Patch
|
|
329
334
|
# @return [Object] Deserialized data
|
330
335
|
def _deserialize(type, value)
|
331
336
|
case type.to_sym
|
332
|
-
when :
|
333
|
-
|
337
|
+
when :Time
|
338
|
+
Time.parse(value)
|
334
339
|
when :Date
|
335
340
|
Date.parse(value)
|
336
341
|
when :String
|
@@ -360,7 +365,9 @@ module Patch
|
|
360
365
|
end
|
361
366
|
end
|
362
367
|
else # model
|
363
|
-
|
368
|
+
# models (e.g. Pet) or oneOf
|
369
|
+
klass = Patch.const_get(type)
|
370
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
364
371
|
end
|
365
372
|
end
|
366
373
|
|
@@ -386,7 +393,7 @@ module Patch
|
|
386
393
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
387
394
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
388
395
|
end
|
389
|
-
|
396
|
+
|
390
397
|
hash[param] = _to_hash(value)
|
391
398
|
end
|
392
399
|
hash
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
Contact: developers@usepatch.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Patch
|
16
17
|
class ProjectListResponse
|
@@ -32,6 +33,11 @@ module Patch
|
|
32
33
|
}
|
33
34
|
end
|
34
35
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
35
41
|
# Attribute type mapping.
|
36
42
|
def self.openapi_types
|
37
43
|
{
|
@@ -42,15 +48,14 @@ module Patch
|
|
42
48
|
}
|
43
49
|
end
|
44
50
|
|
45
|
-
#
|
51
|
+
# List of attributes with nullable: true
|
46
52
|
def self.openapi_nullable
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
nullable_properties
|
53
|
+
Set.new([
|
54
|
+
:'error',
|
55
|
+
])
|
52
56
|
end
|
53
57
|
|
58
|
+
|
54
59
|
# Allows models with corresponding API classes to delegate API operations to those API classes
|
55
60
|
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
|
56
61
|
# Eg. Order.create_order delegates to OrdersApi.new.create_order
|
@@ -160,7 +165,9 @@ module Patch
|
|
160
165
|
def build_from_hash(attributes)
|
161
166
|
return nil unless attributes.is_a?(Hash)
|
162
167
|
self.class.openapi_types.each_pair do |key, type|
|
163
|
-
if
|
168
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
169
|
+
self.send("#{key}=", nil)
|
170
|
+
elsif type =~ /\AArray<(.*)>/i
|
164
171
|
# check to ensure the input is an array given that the attribute
|
165
172
|
# is documented as an array but the input is not
|
166
173
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -168,7 +175,7 @@ module Patch
|
|
168
175
|
end
|
169
176
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
170
177
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
171
|
-
end
|
178
|
+
end
|
172
179
|
end
|
173
180
|
|
174
181
|
self
|
@@ -180,8 +187,8 @@ module Patch
|
|
180
187
|
# @return [Object] Deserialized data
|
181
188
|
def _deserialize(type, value)
|
182
189
|
case type.to_sym
|
183
|
-
when :
|
184
|
-
|
190
|
+
when :Time
|
191
|
+
Time.parse(value)
|
185
192
|
when :Date
|
186
193
|
Date.parse(value)
|
187
194
|
when :String
|
@@ -211,7 +218,9 @@ module Patch
|
|
211
218
|
end
|
212
219
|
end
|
213
220
|
else # model
|
214
|
-
|
221
|
+
# models (e.g. Pet) or oneOf
|
222
|
+
klass = Patch.const_get(type)
|
223
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
215
224
|
end
|
216
225
|
end
|
217
226
|
|
@@ -237,7 +246,7 @@ module Patch
|
|
237
246
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
238
247
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
239
248
|
end
|
240
|
-
|
249
|
+
|
241
250
|
hash[param] = _to_hash(value)
|
242
251
|
end
|
243
252
|
hash
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
Contact: developers@usepatch.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module Patch
|
16
17
|
class ProjectResponse
|
@@ -29,6 +30,11 @@ module Patch
|
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
32
38
|
# Attribute type mapping.
|
33
39
|
def self.openapi_types
|
34
40
|
{
|
@@ -38,15 +44,14 @@ module Patch
|
|
38
44
|
}
|
39
45
|
end
|
40
46
|
|
41
|
-
#
|
47
|
+
# List of attributes with nullable: true
|
42
48
|
def self.openapi_nullable
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
nullable_properties
|
49
|
+
Set.new([
|
50
|
+
:'error',
|
51
|
+
])
|
48
52
|
end
|
49
53
|
|
54
|
+
|
50
55
|
# Allows models with corresponding API classes to delegate API operations to those API classes
|
51
56
|
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
|
52
57
|
# Eg. Order.create_order delegates to OrdersApi.new.create_order
|
@@ -144,7 +149,9 @@ module Patch
|
|
144
149
|
def build_from_hash(attributes)
|
145
150
|
return nil unless attributes.is_a?(Hash)
|
146
151
|
self.class.openapi_types.each_pair do |key, type|
|
147
|
-
if
|
152
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
153
|
+
self.send("#{key}=", nil)
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
148
155
|
# check to ensure the input is an array given that the attribute
|
149
156
|
# is documented as an array but the input is not
|
150
157
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -152,7 +159,7 @@ module Patch
|
|
152
159
|
end
|
153
160
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
161
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
155
|
-
end
|
162
|
+
end
|
156
163
|
end
|
157
164
|
|
158
165
|
self
|
@@ -164,8 +171,8 @@ module Patch
|
|
164
171
|
# @return [Object] Deserialized data
|
165
172
|
def _deserialize(type, value)
|
166
173
|
case type.to_sym
|
167
|
-
when :
|
168
|
-
|
174
|
+
when :Time
|
175
|
+
Time.parse(value)
|
169
176
|
when :Date
|
170
177
|
Date.parse(value)
|
171
178
|
when :String
|
@@ -195,7 +202,9 @@ module Patch
|
|
195
202
|
end
|
196
203
|
end
|
197
204
|
else # model
|
198
|
-
|
205
|
+
# models (e.g. Pet) or oneOf
|
206
|
+
klass = Patch.const_get(type)
|
207
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
199
208
|
end
|
200
209
|
end
|
201
210
|
|
@@ -221,7 +230,7 @@ module Patch
|
|
221
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
222
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
223
232
|
end
|
224
|
-
|
233
|
+
|
225
234
|
hash[param] = _to_hash(value)
|
226
235
|
end
|
227
236
|
hash
|