deimos-ruby 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/README.md +1 -1
  4. data/lib/deimos/schema_class/record.rb +1 -2
  5. data/lib/deimos/version.rb +1 -1
  6. data/lib/generators/deimos/schema_class/templates/schema_record.rb.tt +1 -0
  7. data/lib/generators/deimos/schema_class_generator.rb +1 -1
  8. data/spec/consumer_spec.rb +25 -4
  9. data/spec/schemas/my_namespace/generated.rb +6 -4
  10. data/spec/schemas/my_namespace/my_long_namespace_schema.rb +2 -1
  11. data/spec/schemas/my_namespace/my_nested_schema.rb +6 -4
  12. data/spec/schemas/my_namespace/my_schema.rb +4 -3
  13. data/spec/schemas/my_namespace/my_schema_compound_key.rb +2 -1
  14. data/spec/schemas/my_namespace/my_schema_id_key.rb +2 -1
  15. data/spec/schemas/my_namespace/my_schema_key.rb +2 -1
  16. data/spec/schemas/my_namespace/my_schema_with_boolean.rb +2 -1
  17. data/spec/schemas/my_namespace/my_schema_with_circular_reference.rb +5 -3
  18. data/spec/schemas/my_namespace/my_schema_with_complex_type.rb +11 -9
  19. data/spec/schemas/my_namespace/my_schema_with_date_time.rb +2 -1
  20. data/spec/schemas/my_namespace/my_schema_with_id.rb +2 -1
  21. data/spec/schemas/my_namespace/my_schema_with_title.rb +47 -0
  22. data/spec/schemas/my_namespace/my_schema_with_union_type.rb +12 -7
  23. data/spec/schemas/my_namespace/my_schema_with_unique_id.rb +2 -1
  24. data/spec/schemas/my_namespace/request/create_topic.rb +2 -1
  25. data/spec/schemas/my_namespace/request/index.rb +2 -1
  26. data/spec/schemas/my_namespace/request/update_request.rb +2 -1
  27. data/spec/schemas/my_namespace/response/create_topic.rb +2 -1
  28. data/spec/schemas/my_namespace/response/index.rb +2 -1
  29. data/spec/schemas/my_namespace/response/update_response.rb +2 -1
  30. data/spec/schemas/my_namespace/wibble.rb +2 -1
  31. data/spec/schemas/my_namespace/widget.rb +2 -1
  32. data/spec/schemas/my_namespace/widget_the_second.rb +2 -1
  33. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e82467b470c2851af2ba3baecdf2cbfbbc6d973dc74b18d127ddf6967da55c1
4
- data.tar.gz: 85a868445b7b1eb085e040948727217a8b7f7f6141a9ad94de25faf74b1ce9c3
3
+ metadata.gz: 60b8a371a3669c29d7f59694bc49af057412313aeb08eebab2b88d4dbc5b6da4
4
+ data.tar.gz: 9c7231954c6db7ee55ffd4d3e18351bc7470acd443555f270c589da37e054631
5
5
  SHA512:
6
- metadata.gz: c64525a2de886bacf3cecbb9142d082f5b3864965ac361964bfb99fdc041ac6b5c6805c0415e67fb5c21258a231debcf94d187e28de7739bcaaa5fbd0f65d5ad
7
- data.tar.gz: e4c88334002328f1a9f069e65f8bfc6616efb70a4b1fc56da3ef443e2dd767c2492294a1e7a07972b7b670c02055f37ba1cf3dd6a1630875f75ff07d03c1e631
6
+ metadata.gz: 294627ab365d88be5f0617422a88bbd15fe81b46eae81dc663aff66174377145ccbbac218c205b5fbaf2d0dbdef31f0586e43607381423e0cd13cbb673f6913a
7
+ data.tar.gz: 216b9300910d20feb4786f4798542fc32a6a1f957dc19dc50209877853424a5d13e208f08f42c38fe420c86ec73e6b620e95a8f20d8700c1a7b3713f8f54472b
data/CHANGELOG.md CHANGED
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## UNRELEASED
9
9
 
10
- ## 2.1.1 - 2025-07-21
10
+ ## 2.1.2 - 2025-07-21
11
11
 
12
12
  - Fix: Backwards-compatible fix wasn't working correctly.
13
13
 
data/README.md CHANGED
@@ -1083,7 +1083,7 @@ decoded = Deimos.decode(schema: 'MySchema', namespace: 'com.my-namespace', paylo
1083
1083
 
1084
1084
  Bug reports and pull requests are welcome on GitHub at https://github.com/flipp-oss/deimos .
1085
1085
 
1086
- If making changes to the generator, you should regenerate the test schema classes by running `./regenerate_test_schema_classes.rb` .
1086
+ If making changes to the generator, you should regenerate the test schema classes by running `bundle exec ./regenerate_test_schema_classes.rb` .
1087
1087
 
1088
1088
  You can/should re-generate RBS types when methods or classes change by running the following:
1089
1089
 
@@ -79,8 +79,7 @@ module Deimos
79
79
  def self.new_from_message(**kwargs)
80
80
  record = self.new
81
81
  attrs = kwargs.select { |k, v| record.respond_to?("#{k}=") }
82
- record = self.new(**attrs)
83
- record._from_message = true
82
+ record = self.new(_from_message: true, **attrs)
84
83
  record
85
84
  end
86
85
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '2.1.1'
4
+ VERSION = '2.1.2'
5
5
  end
@@ -66,6 +66,7 @@
66
66
  <% end -%>
67
67
  # @override
68
68
  <%= @initialization_definition %>
69
+ @_from_message = _from_message
69
70
  super
70
71
  <%- @fields.each do |field| -%>
71
72
  self.<%= field.name %> = <%= field.name %>
@@ -260,7 +260,7 @@ module Deimos
260
260
  arg.strip
261
261
  end
262
262
 
263
- result = "def initialize(#{arguments.first}"
263
+ result = "def initialize(_from_message: false, #{arguments.first}"
264
264
  arguments[1..-1].each_with_index do |arg, _i|
265
265
  result += ",#{INITIALIZE_WHITESPACE}#{arg}"
266
266
  end
@@ -180,7 +180,19 @@ module ConsumerTest
180
180
  }
181
181
  end
182
182
  # update the Avro to include a new field
183
- generator.append_to_file(schema_file, additional_field_json, after: '"fields": [')
183
+ generator.insert_into_file(schema_file, additional_field_json, after: '"fields": [', force: true)
184
+
185
+ Karafka::App.routes.redraw do
186
+ topic 'my_consume_topic' do
187
+ schema 'MyNestedSchema'
188
+ namespace 'com.my-namespace'
189
+ key_config field: 'test_id'
190
+ consumer ConsumerTest::MyConsumer
191
+ reraise_errors true
192
+ use_schema_classes true
193
+ reraise_errors true
194
+ end
195
+ end
184
196
  end
185
197
 
186
198
  after(:each) do
@@ -188,7 +200,7 @@ module ConsumerTest
188
200
  end
189
201
 
190
202
  let(:generator) { Rails::Generators::Base.new }
191
- let(:schema_file) { File.join(__dir__, 'schemas/com/my-namespace/MySchema.avsc') }
203
+ let(:schema_file) { File.join(__dir__, 'schemas/com/my-namespace/MyNestedSchema.avsc') }
192
204
  let(:additional_field_json) do
193
205
  '{"name": "additional_field", "type": "string", "default": ""},'
194
206
  end
@@ -196,11 +208,20 @@ module ConsumerTest
196
208
  it 'should consume correctly and ignore the additional field' do
197
209
  test_consume_message('my_consume_topic',
198
210
  { 'test_id' => 'foo',
211
+ 'test_float' => 4.0,
212
+ 'test_array' => ["1", "2"],
199
213
  'additional_field' => 'bar',
200
- 'some_int' => 1 }) do |payload, _metadata|
214
+ 'some_nested_record' => {
215
+ 'some_int' => 1,
216
+ 'some_float' => 10.0,
217
+ 'some_string' => 'hi mom',
218
+ 'additional_field' => 'baz'
219
+ } }) do |payload, _metadata|
201
220
  expect(payload['test_id']).to eq('foo')
202
- expect(payload['some_int']).to eq(1)
221
+ expect(payload['test_float']).to eq(4.0)
222
+ expect(payload['some_nested_record']['some_int']).to eq(1)
203
223
  expect(payload.to_h).not_to have_key('additional_field')
224
+ expect(payload.to_h['some_nested_record']).not_to have_key('additional_field')
204
225
  end
205
226
 
206
227
  end
@@ -15,7 +15,8 @@ module Schemas; module MyNamespace
15
15
  attr_accessor :a_record_field
16
16
 
17
17
  # @override
18
- def initialize(a_record_field: nil)
18
+ def initialize(_from_message: false, a_record_field: nil)
19
+ @_from_message = _from_message
19
20
  super
20
21
  self.a_record_field = a_record_field
21
22
  end
@@ -81,16 +82,16 @@ module Schemas; module MyNamespace
81
82
  ### Attribute Writers ###
82
83
  # @return [AnEnum]
83
84
  def an_enum=(value)
84
- @an_enum = AnEnum.initialize_from_value(value, from_message: @from_message)
85
+ @an_enum = AnEnum.initialize_from_value(value, from_message: self._from_message)
85
86
  end
86
87
 
87
88
  # @return [ARecord]
88
89
  def a_record=(value)
89
- @a_record = ARecord.initialize_from_value(value, from_message: @from_message)
90
+ @a_record = ARecord.initialize_from_value(value, from_message: self._from_message)
90
91
  end
91
92
 
92
93
  # @override
93
- def initialize(a_string: nil,
94
+ def initialize(_from_message: false, a_string: nil,
94
95
  a_int: nil,
95
96
  a_long: nil,
96
97
  a_float: nil,
@@ -102,6 +103,7 @@ module Schemas; module MyNamespace
102
103
  timestamp: nil,
103
104
  message_id: nil,
104
105
  a_record: nil)
106
+ @_from_message = _from_message
105
107
  super
106
108
  self.a_string = a_string
107
109
  self.a_int = a_int
@@ -13,8 +13,9 @@ module Schemas; module MyNamespace
13
13
  attr_accessor :some_int
14
14
 
15
15
  # @override
16
- def initialize(test_id: nil,
16
+ def initialize(_from_message: false, test_id: nil,
17
17
  some_int: nil)
18
+ @_from_message = _from_message
18
19
  super
19
20
  self.test_id = test_id
20
21
  self.some_int = some_int
@@ -21,10 +21,11 @@ module Schemas; module MyNamespace
21
21
  attr_accessor :some_optional_int
22
22
 
23
23
  # @override
24
- def initialize(some_int: nil,
24
+ def initialize(_from_message: false, some_int: nil,
25
25
  some_float: nil,
26
26
  some_string: nil,
27
27
  some_optional_int: nil)
28
+ @_from_message = _from_message
28
29
  super
29
30
  self.some_int = some_int
30
31
  self.some_float = some_float
@@ -71,20 +72,21 @@ module Schemas; module MyNamespace
71
72
  ### Attribute Writers ###
72
73
  # @return [MyNestedRecord]
73
74
  def some_nested_record=(value)
74
- @some_nested_record = MyNestedRecord.initialize_from_value(value, from_message: @from_message)
75
+ @some_nested_record = MyNestedRecord.initialize_from_value(value, from_message: self._from_message)
75
76
  end
76
77
 
77
78
  # @return [nil, MyNestedRecord]
78
79
  def some_optional_record=(value)
79
- @some_optional_record = MyNestedRecord.initialize_from_value(value, from_message: @from_message)
80
+ @some_optional_record = MyNestedRecord.initialize_from_value(value, from_message: self._from_message)
80
81
  end
81
82
 
82
83
  # @override
83
- def initialize(test_id: nil,
84
+ def initialize(_from_message: false, test_id: nil,
84
85
  test_float: nil,
85
86
  test_array: nil,
86
87
  some_nested_record: nil,
87
88
  some_optional_record: nil)
89
+ @_from_message = _from_message
88
90
  super
89
91
  self.test_id = test_id
90
92
  self.test_float = test_float
@@ -19,13 +19,14 @@ module Schemas; module MyNamespace
19
19
  ### Attribute Writers ###
20
20
  # @return [MySchemaKey]
21
21
  def payload_key=(value)
22
- @payload_key = MySchemaKey.initialize_from_value(value, from_message: @from_message)
22
+ @payload_key = MySchemaKey.initialize_from_value(value, from_message: self._from_message)
23
23
  end
24
24
 
25
25
  # @override
26
- def initialize(test_id: nil,
26
+ def initialize(_from_message: false, test_id: nil,
27
27
  some_int: nil,
28
28
  payload_key: nil)
29
+ @_from_message = _from_message
29
30
  super
30
31
  self.test_id = test_id
31
32
  self.some_int = some_int
@@ -44,7 +45,7 @@ module Schemas; module MyNamespace
44
45
 
45
46
  def self.tombstone(key)
46
47
  record = self.allocate
47
- record.tombstone_key = MySchemaKey.initialize_from_value(key, from_message: @from_message)
48
+ record.tombstone_key = MySchemaKey.initialize_from_value(key, from_message: self._from_message)
48
49
  record.payload_key = key
49
50
  record
50
51
  end
@@ -13,8 +13,9 @@ module Schemas; module MyNamespace
13
13
  attr_accessor :part_two
14
14
 
15
15
  # @override
16
- def initialize(part_one: nil,
16
+ def initialize(_from_message: false, part_one: nil,
17
17
  part_two: nil)
18
+ @_from_message = _from_message
18
19
  super
19
20
  self.part_one = part_one
20
21
  self.part_two = part_two
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace
11
11
  attr_accessor :id
12
12
 
13
13
  # @override
14
- def initialize(id: nil)
14
+ def initialize(_from_message: false, id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.id = id
17
18
  end
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace
11
11
  attr_accessor :test_id
12
12
 
13
13
  # @override
14
- def initialize(test_id: nil)
14
+ def initialize(_from_message: false, test_id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.test_id = test_id
17
18
  end
@@ -13,8 +13,9 @@ module Schemas; module MyNamespace
13
13
  attr_accessor :some_bool
14
14
 
15
15
  # @override
16
- def initialize(test_id: nil,
16
+ def initialize(_from_message: false, test_id: nil,
17
17
  some_bool: nil)
18
+ @_from_message = _from_message
18
19
  super
19
20
  self.test_id = test_id
20
21
  self.some_bool = some_bool
@@ -15,7 +15,8 @@ module Schemas; module MyNamespace
15
15
  attr_accessor :property
16
16
 
17
17
  # @override
18
- def initialize(property: nil)
18
+ def initialize(_from_message: false, property: nil)
19
+ @_from_message = _from_message
19
20
  super
20
21
  self.property = property
21
22
  end
@@ -47,12 +48,13 @@ module Schemas; module MyNamespace
47
48
  # @return [Hash<String, Property>]
48
49
  def properties=(values)
49
50
  @properties = values&.transform_values do |value|
50
- Property.initialize_from_value(value, from_message: @from_message)
51
+ Property.initialize_from_value(value, from_message: self._from_message)
51
52
  end
52
53
  end
53
54
 
54
55
  # @override
55
- def initialize(properties: {})
56
+ def initialize(_from_message: false, properties: {})
57
+ @_from_message = _from_message
56
58
  super
57
59
  self.properties = properties
58
60
  end
@@ -15,7 +15,8 @@ module Schemas; module MyNamespace
15
15
  attr_accessor :a_record_field
16
16
 
17
17
  # @override
18
- def initialize(a_record_field: nil)
18
+ def initialize(_from_message: false, a_record_field: nil)
19
+ @_from_message = _from_message
19
20
  super
20
21
  self.a_record_field = a_record_field
21
22
  end
@@ -105,47 +106,47 @@ module Schemas; module MyNamespace
105
106
  ### Attribute Writers ###
106
107
  # @return [ARecord]
107
108
  def some_record=(value)
108
- @some_record = ARecord.initialize_from_value(value, from_message: @from_message)
109
+ @some_record = ARecord.initialize_from_value(value, from_message: self._from_message)
109
110
  end
110
111
 
111
112
  # @return [nil, ARecord]
112
113
  def some_optional_record=(value)
113
- @some_optional_record = ARecord.initialize_from_value(value, from_message: @from_message)
114
+ @some_optional_record = ARecord.initialize_from_value(value, from_message: self._from_message)
114
115
  end
115
116
 
116
117
  # @return [Array<ARecord>]
117
118
  def some_record_array=(values)
118
119
  @some_record_array = values&.map do |value|
119
- ARecord.initialize_from_value(value, from_message: @from_message)
120
+ ARecord.initialize_from_value(value, from_message: self._from_message)
120
121
  end
121
122
  end
122
123
 
123
124
  # @return [Hash<String, ARecord>]
124
125
  def some_record_map=(values)
125
126
  @some_record_map = values&.transform_values do |value|
126
- ARecord.initialize_from_value(value, from_message: @from_message)
127
+ ARecord.initialize_from_value(value, from_message: self._from_message)
127
128
  end
128
129
  end
129
130
 
130
131
  # @return [Array<AnEnum>]
131
132
  def some_enum_array=(values)
132
133
  @some_enum_array = values&.map do |value|
133
- AnEnum.initialize_from_value(value, from_message: @from_message)
134
+ AnEnum.initialize_from_value(value, from_message: self._from_message)
134
135
  end
135
136
  end
136
137
 
137
138
  # @return [nil, AnotherEnum]
138
139
  def some_optional_enum=(value)
139
- @some_optional_enum = AnotherEnum.initialize_from_value(value, from_message: @from_message)
140
+ @some_optional_enum = AnotherEnum.initialize_from_value(value, from_message: self._from_message)
140
141
  end
141
142
 
142
143
  # @return [YetAnotherEnum]
143
144
  def some_enum_with_default=(value)
144
- @some_enum_with_default = YetAnotherEnum.initialize_from_value(value, from_message: @from_message)
145
+ @some_enum_with_default = YetAnotherEnum.initialize_from_value(value, from_message: self._from_message)
145
146
  end
146
147
 
147
148
  # @override
148
- def initialize(test_id: nil,
149
+ def initialize(_from_message: false, test_id: nil,
149
150
  test_float: nil,
150
151
  test_string_array: ["test"],
151
152
  test_int_array: [123],
@@ -158,6 +159,7 @@ module Schemas; module MyNamespace
158
159
  some_enum_array: nil,
159
160
  some_optional_enum: nil,
160
161
  some_enum_with_default: "sym6")
162
+ @_from_message = _from_message
161
163
  super
162
164
  self.test_id = test_id
163
165
  self.test_float = test_float
@@ -19,11 +19,12 @@ module Schemas; module MyNamespace
19
19
  attr_accessor :timestamp
20
20
 
21
21
  # @override
22
- def initialize(test_id: nil,
22
+ def initialize(_from_message: false, test_id: nil,
23
23
  updated_at: nil,
24
24
  some_int: nil,
25
25
  some_datetime_int: nil,
26
26
  timestamp: nil)
27
+ @_from_message = _from_message
27
28
  super
28
29
  self.test_id = test_id
29
30
  self.updated_at = updated_at
@@ -17,10 +17,11 @@ module Schemas; module MyNamespace
17
17
  attr_accessor :timestamp
18
18
 
19
19
  # @override
20
- def initialize(test_id: nil,
20
+ def initialize(_from_message: false, test_id: nil,
21
21
  some_int: nil,
22
22
  message_id: nil,
23
23
  timestamp: nil)
24
+ @_from_message = _from_message
24
25
  super
25
26
  self.test_id = test_id
26
27
  self.some_int = some_int
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is autogenerated by Deimos, Do NOT modify
4
+ module Schemas; module MyNamespace
5
+ ### Primary Schema Class ###
6
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
7
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
8
+
9
+ ### Attribute Accessors ###
10
+ # @return [String]
11
+ attr_accessor :test_id
12
+ # @return [Integer]
13
+ attr_accessor :some_int
14
+ # @return [String]
15
+ attr_accessor :title
16
+
17
+ # @override
18
+ def initialize(_from_message: false, test_id: nil,
19
+ some_int: nil,
20
+ title: nil)
21
+ @_from_message = _from_message
22
+ super
23
+ self.test_id = test_id
24
+ self.some_int = some_int
25
+ self.title = title
26
+ end
27
+
28
+ # @override
29
+ def schema
30
+ 'MySchemaWithTitle'
31
+ end
32
+
33
+ # @override
34
+ def namespace
35
+ 'com.my-namespace'
36
+ end
37
+
38
+ # @override
39
+ def as_json(_opts={})
40
+ {
41
+ 'test_id' => @test_id,
42
+ 'some_int' => @some_int,
43
+ 'title' => @title
44
+ }
45
+ end
46
+ end
47
+ end; end
@@ -17,8 +17,9 @@ module Schemas; module MyNamespace
17
17
  attr_accessor :record1_id
18
18
 
19
19
  # @override
20
- def initialize(record1_map: {},
20
+ def initialize(_from_message: false, record1_map: {},
21
21
  record1_id: 0)
22
+ @_from_message = _from_message
22
23
  super
23
24
  self.record1_map = record1_map
24
25
  self.record1_id = record1_id
@@ -51,7 +52,8 @@ module Schemas; module MyNamespace
51
52
  attr_accessor :record2_id
52
53
 
53
54
  # @override
54
- def initialize(record2_id: "")
55
+ def initialize(_from_message: false, record2_id: "")
56
+ @_from_message = _from_message
55
57
  super
56
58
  self.record2_id = record2_id
57
59
  end
@@ -82,7 +84,8 @@ module Schemas; module MyNamespace
82
84
  attr_accessor :record3_id
83
85
 
84
86
  # @override
85
- def initialize(record3_id: 0.0)
87
+ def initialize(_from_message: false, record3_id: 0.0)
88
+ @_from_message = _from_message
86
89
  super
87
90
  self.record3_id = record3_id
88
91
  end
@@ -113,7 +116,8 @@ module Schemas; module MyNamespace
113
116
  attr_accessor :record4_id
114
117
 
115
118
  # @override
116
- def initialize(record4_id: 0)
119
+ def initialize(_from_message: false, record4_id: 0)
120
+ @_from_message = _from_message
117
121
  super
118
122
  self.record4_id = record4_id
119
123
  end
@@ -150,7 +154,7 @@ module Schemas; module MyNamespace
150
154
  ### Attribute Writers ###
151
155
  # @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
152
156
  def test_union_type=(value)
153
- @test_union_type = initialize_test_union_type_type(value, from_message: @from_message)
157
+ @test_union_type = initialize_test_union_type_type(value, from_message: self._from_message)
154
158
  end
155
159
 
156
160
  # Helper method to determine which schema type to use for test_union_type
@@ -165,13 +169,14 @@ module Schemas; module MyNamespace
165
169
  (value.keys - fields).empty?
166
170
  end
167
171
 
168
- klass.initialize_from_value(value, from_message: @from_message)
172
+ klass.initialize_from_value(value, from_message: self._from_message)
169
173
  end
170
174
 
171
175
  # @override
172
- def initialize(test_id: "",
176
+ def initialize(_from_message: false, test_id: "",
173
177
  test_long: nil,
174
178
  test_union_type: nil)
179
+ @_from_message = _from_message
175
180
  super
176
181
  self.test_id = test_id
177
182
  self.test_long = test_long
@@ -19,11 +19,12 @@ module Schemas; module MyNamespace
19
19
  attr_accessor :timestamp
20
20
 
21
21
  # @override
22
- def initialize(id: nil,
22
+ def initialize(_from_message: false, id: nil,
23
23
  test_id: nil,
24
24
  some_int: nil,
25
25
  message_id: nil,
26
26
  timestamp: nil)
27
+ @_from_message = _from_message
27
28
  super
28
29
  self.id = id
29
30
  self.test_id = test_id
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace; module Request
11
11
  attr_accessor :request_id
12
12
 
13
13
  # @override
14
- def initialize(request_id: nil)
14
+ def initialize(_from_message: false, request_id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.request_id = request_id
17
18
  end
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace; module Request
11
11
  attr_accessor :request_id
12
12
 
13
13
  # @override
14
- def initialize(request_id: nil)
14
+ def initialize(_from_message: false, request_id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.request_id = request_id
17
18
  end
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace; module Request
11
11
  attr_accessor :update_request_id
12
12
 
13
13
  # @override
14
- def initialize(update_request_id: nil)
14
+ def initialize(_from_message: false, update_request_id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.update_request_id = update_request_id
17
18
  end
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace; module Response
11
11
  attr_accessor :response_id
12
12
 
13
13
  # @override
14
- def initialize(response_id: nil)
14
+ def initialize(_from_message: false, response_id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.response_id = response_id
17
18
  end
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace; module Response
11
11
  attr_accessor :response_id
12
12
 
13
13
  # @override
14
- def initialize(response_id: nil)
14
+ def initialize(_from_message: false, response_id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.response_id = response_id
17
18
  end
@@ -11,7 +11,8 @@ module Schemas; module MyNamespace; module Response
11
11
  attr_accessor :update_response_id
12
12
 
13
13
  # @override
14
- def initialize(update_response_id: nil)
14
+ def initialize(_from_message: false, update_response_id: nil)
15
+ @_from_message = _from_message
15
16
  super
16
17
  self.update_response_id = update_response_id
17
18
  end
@@ -27,7 +27,7 @@ module Schemas; module MyNamespace
27
27
  attr_accessor :created_at
28
28
 
29
29
  # @override
30
- def initialize(id: nil,
30
+ def initialize(_from_message: false, id: nil,
31
31
  wibble_id: nil,
32
32
  name: nil,
33
33
  floop: nil,
@@ -36,6 +36,7 @@ module Schemas; module MyNamespace
36
36
  birthday_optional: nil,
37
37
  updated_at: nil,
38
38
  created_at: nil)
39
+ @_from_message = _from_message
39
40
  super
40
41
  self.id = id
41
42
  self.wibble_id = wibble_id
@@ -19,11 +19,12 @@ module Schemas; module MyNamespace
19
19
  attr_accessor :created_at
20
20
 
21
21
  # @override
22
- def initialize(id: nil,
22
+ def initialize(_from_message: false, id: nil,
23
23
  widget_id: nil,
24
24
  name: nil,
25
25
  updated_at: nil,
26
26
  created_at: nil)
27
+ @_from_message = _from_message
27
28
  super
28
29
  self.id = id
29
30
  self.widget_id = widget_id
@@ -19,11 +19,12 @@ module Schemas; module MyNamespace
19
19
  attr_accessor :created_at
20
20
 
21
21
  # @override
22
- def initialize(id: nil,
22
+ def initialize(_from_message: false, id: nil,
23
23
  widget_id: nil,
24
24
  model_id: nil,
25
25
  updated_at: nil,
26
26
  created_at: nil)
27
+ @_from_message = _from_message
27
28
  super
28
29
  self.id = id
29
30
  self.widget_id = widget_id
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
@@ -596,6 +596,7 @@ files:
596
596
  - spec/schemas/my_namespace/my_schema_with_complex_type.rb
597
597
  - spec/schemas/my_namespace/my_schema_with_date_time.rb
598
598
  - spec/schemas/my_namespace/my_schema_with_id.rb
599
+ - spec/schemas/my_namespace/my_schema_with_title.rb
599
600
  - spec/schemas/my_namespace/my_schema_with_union_type.rb
600
601
  - spec/schemas/my_namespace/my_schema_with_unique_id.rb
601
602
  - spec/schemas/my_namespace/my_updated_schema.rb
@@ -725,6 +726,7 @@ test_files:
725
726
  - spec/schemas/my_namespace/my_schema_with_complex_type.rb
726
727
  - spec/schemas/my_namespace/my_schema_with_date_time.rb
727
728
  - spec/schemas/my_namespace/my_schema_with_id.rb
729
+ - spec/schemas/my_namespace/my_schema_with_title.rb
728
730
  - spec/schemas/my_namespace/my_schema_with_union_type.rb
729
731
  - spec/schemas/my_namespace/my_schema_with_unique_id.rb
730
732
  - spec/schemas/my_namespace/my_updated_schema.rb