deimos-ruby 1.23.3 → 1.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/docs/CONFIGURATION.md +2 -1
  4. data/lib/deimos/config/configuration.rb +7 -1
  5. data/lib/deimos/utils/schema_class.rb +18 -3
  6. data/lib/deimos/version.rb +1 -1
  7. data/lib/generators/deimos/schema_class_generator.rb +9 -2
  8. data/regenerate_test_schema_classes.rb +13 -2
  9. data/spec/active_record_batch_consumer_spec.rb +1 -1
  10. data/spec/active_record_consumer_spec.rb +1 -1
  11. data/spec/active_record_producer_spec.rb +1 -1
  12. data/spec/batch_consumer_spec.rb +1 -1
  13. data/spec/consumer_spec.rb +2 -2
  14. data/spec/generators/schema_class_generator_spec.rb +18 -1
  15. data/spec/schemas/com/my-namespace/my-suborg/MyLongNamespaceSchema.avsc +18 -0
  16. data/spec/schemas/my_namespace/generated.rb +1 -1
  17. data/spec/schemas/my_namespace/my_long_namespace_schema.rb +48 -0
  18. data/spec/schemas/my_namespace/my_nested_schema.rb +1 -1
  19. data/spec/schemas/my_namespace/my_schema.rb +1 -1
  20. data/spec/schemas/my_namespace/my_schema_with_circular_reference.rb +1 -1
  21. data/spec/schemas/my_namespace/my_schema_with_complex_type.rb +2 -2
  22. data/spec/schemas/my_namespace/my_updated_schema.rb +2 -1
  23. data/spec/schemas/{request → my_namespace/request}/create_topic.rb +2 -2
  24. data/spec/schemas/{request → my_namespace/request}/index.rb +2 -2
  25. data/spec/schemas/{request → my_namespace/request}/update_request.rb +2 -2
  26. data/spec/schemas/{response → my_namespace/response}/create_topic.rb +2 -2
  27. data/spec/schemas/{response → my_namespace/response}/index.rb +2 -2
  28. data/spec/schemas/{response → my_namespace/response}/update_response.rb +2 -2
  29. data/spec/snapshots/consumers-no-nest.snap +44 -0
  30. data/spec/snapshots/consumers.snap +44 -0
  31. data/spec/snapshots/consumers_and_producers-no-nest.snap +44 -0
  32. data/spec/snapshots/consumers_and_producers.snap +44 -0
  33. data/spec/snapshots/consumers_circular-no-nest.snap +44 -0
  34. data/spec/snapshots/consumers_circular.snap +44 -0
  35. data/spec/snapshots/consumers_complex_types-no-nest.snap +44 -0
  36. data/spec/snapshots/consumers_complex_types.snap +44 -0
  37. data/spec/snapshots/consumers_nested-no-nest.snap +44 -0
  38. data/spec/snapshots/consumers_nested.snap +44 -0
  39. data/spec/snapshots/namespace_folders.snap +254 -210
  40. data/spec/snapshots/namespace_map.snap +1450 -0
  41. data/spec/snapshots/producers_with_key-no-nest.snap +44 -0
  42. data/spec/snapshots/producers_with_key.snap +44 -0
  43. metadata +20 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42d51126a6bf86b0aa338798c9b9a4b479154eda722394940df0bbc8a23e3947
4
- data.tar.gz: 8d6c27244277078ea3b5d2a23440071aba43db3938c43cbbfe4fef27db207556
3
+ metadata.gz: 391cad2b23e7a6ef37106dcc5403af4ef5b62a82c1a6189e712fb3bc339613d1
4
+ data.tar.gz: 2bbb4468ee975158489ea797ee67c636d1c5da88cda8b10b33923b4410459178
5
5
  SHA512:
6
- metadata.gz: 86d98c4e4cc84a380b69196c4d04c51a6a8aaaa05601e2d7deac536495d7c689c987555e23e1bcafb895dc78e24492c9c0b174ee273c0859c9d76795a510d154
7
- data.tar.gz: 8e7875b92bb043c95721a9a12747f6f6727bc225f1802f5d6a6ba34ee4757884347aaa42b3050d9b77f668b7ebd2654aa322cd46dea3c426d140a191c19f7fb0
6
+ metadata.gz: 48f37dc3bf2d016bc8806ccf26def976af003a4a8ebd46dad37e080fdeb9489f0bd3993747feda26a6e37d997b24f169554bb587e8d7ca88af6de85cf41851dd
7
+ data.tar.gz: ccee77567b4599bacc341e25f8c653a3f4ce21252c39dfb9849ffc2005fe44dc58aaa23537bb636f1545b1a691156225f66e1a909949b0bafb8440efa5269c4e
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## UNRELEASED
9
9
 
10
+ # 1.24.0 - 2024-02-26
11
+
12
+ ***BREAKING CHANGE****
13
+
14
+ - Feature: Rename configuration option `generate_namespace_folders` to `use_full_namespace`. This will now use the entire namespace when generating schema classes
15
+ - Feature: Add configuration option `schema_namespace_map` to enable full control over the namespace for generated schema classes. Requires `use_full_namespace`
16
+
10
17
  # 1.23.3 - 2024-01-25
11
18
  - Feature: Add configuration to skip messages that are too large to publish via DB poller.
12
19
 
@@ -210,7 +210,8 @@ schema.path|nil|Local path to find your schemas.
210
210
  schema.use_schema_classes|false|Set this to true to use generated schema classes in your application.
211
211
  schema.generated_class_path|`app/lib/schema_classes`|Local path to generated schema classes.
212
212
  schema.nest_child_schemas|false|Set to true to nest subschemas within the generated class for the parent schema.
213
- schema.generate_namespace_folders|false|Set to true to generate folders for schemas matching the last part of the namespace.
213
+ schema.use_full_namespace|false|Set to true to generate folders for schemas matching the full namespace.
214
+ schema.schema_namespace_map|{}|A map of namespace prefixes to base module name(s). Example: { 'com.mycompany.suborg' => ['SchemaClasses'] }. Requires `use_full_namespace` to be true.
214
215
 
215
216
  ## Database Producer Configuration
216
217
 
@@ -380,7 +380,13 @@ module Deimos # rubocop:disable Metrics/ModuleLength
380
380
 
381
381
  # Set to true to generate folders matching the last part of the schema namespace.
382
382
  # @return [Boolean]
383
- setting :generate_namespace_folders, false
383
+ setting :use_full_namespace, false
384
+
385
+ # Use this option to reduce nesting when using use_full_namespace.
386
+ # For example: { 'com.mycompany.suborg' => 'SchemaClasses' }
387
+ # would replace a prefixed with the given key with the module name SchemaClasses.
388
+ # @return [Hash]
389
+ setting :schema_namespace_map, {}
384
390
  end
385
391
 
386
392
  # The configured metrics provider.
@@ -10,10 +10,25 @@ module Deimos
10
10
  # @return [Array<String>]
11
11
  def modules_for(namespace)
12
12
  modules = ['Schemas']
13
- namespace_folder = namespace.split('.').last
14
- if Deimos.config.schema.generate_namespace_folders && namespace_folder
15
- modules.push(namespace_folder.underscore.classify)
13
+ namespace_override = nil
14
+ module_namespace = namespace
15
+
16
+ if Deimos.config.schema.use_full_namespace
17
+ if Deimos.config.schema.schema_namespace_map.present?
18
+ namespace_keys = Deimos.config.schema.schema_namespace_map.keys.sort_by { |k| -k.length }
19
+ namespace_override = namespace_keys.find { |k| module_namespace.include?(k) }
20
+ end
21
+
22
+ if namespace_override.present?
23
+ # override default module
24
+ modules = Array(Deimos.config.schema.schema_namespace_map[namespace_override])
25
+ module_namespace = module_namespace.gsub(/#{namespace_override}\.?/, '')
26
+ end
27
+
28
+ namespace_folders = module_namespace.split('.').map { |f| f.underscore.camelize }
29
+ modules.concat(namespace_folders) if namespace_folders.any?
16
30
  end
31
+
17
32
  modules
18
33
  end
19
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.23.3'
4
+ VERSION = '1.24.0'
5
5
  end
@@ -121,9 +121,16 @@ module Deimos
121
121
  @main_class_definition = class_template
122
122
 
123
123
  file_prefix = schema.name.underscore.singularize
124
- if Deimos.config.schema.generate_namespace_folders
125
- file_prefix = "#{@modules.last.underscore.singularize}/#{file_prefix}"
124
+ if Deimos.config.schema.use_full_namespace
125
+ # Use entire namespace for folders
126
+ # but don't add directories that are already in the path
127
+ directories = @modules.map(&:underscore).select do |m|
128
+ Deimos.config.schema.generated_class_path.exclude?(m)
129
+ end
130
+
131
+ file_prefix = "#{directories.join('/')}/#{file_prefix}"
126
132
  end
133
+
127
134
  filename = "#{Deimos.config.schema.generated_class_path}/#{file_prefix}.rb"
128
135
  template(SCHEMA_CLASS_FILE, filename, force: true)
129
136
  end
@@ -21,8 +21,11 @@ Deimos.configure do |deimos_config|
21
21
  deimos_config.schema.path = "spec/schemas"
22
22
  deimos_config.schema.backend = :avro_validation
23
23
  deimos_config.schema.generated_class_path = './spec/schemas'
24
- deimos_config.schema.generate_namespace_folders = true
25
- deimos_config.schema.nest_child_schemas = true
24
+ deimos_config.schema.use_full_namespace = true
25
+ deimos_config.schema.schema_namespace_map = {
26
+ 'com' => 'Schemas',
27
+ 'com.my-namespace.my-suborg' => %w(Schemas MyNamespace)
28
+ }
26
29
 
27
30
  consumer do
28
31
  class_name 'MyConsumer'
@@ -56,6 +59,14 @@ Deimos.configure do |deimos_config|
56
59
  key_config field: :test_id
57
60
  end
58
61
 
62
+ consumer do
63
+ class_name 'MyConsumer'
64
+ topic 'MyTopic'
65
+ schema 'MyLongNamespaceSchema'
66
+ namespace 'com.my-namespace.my-suborg'
67
+ key_config field: :test_id
68
+ end
69
+
59
70
  producer do
60
71
  class_name 'MyConsumer'
61
72
  topic 'MyTopic'
@@ -78,7 +78,7 @@ module ActiveRecordBatchConsumerTest
78
78
  before(:each) do
79
79
  Deimos.configure do |config|
80
80
  config.schema.use_schema_classes = use_schema_classes
81
- config.schema.generate_namespace_folders = true
81
+ config.schema.use_full_namespace = true
82
82
  end
83
83
  end
84
84
 
@@ -143,7 +143,7 @@ module ActiveRecordConsumerTest
143
143
  before(:each) do
144
144
  Deimos.configure do |config|
145
145
  config.schema.use_schema_classes = use_schema_classes
146
- config.schema.generate_namespace_folders = true
146
+ config.schema.use_full_namespace = true
147
147
  end
148
148
  end
149
149
 
@@ -71,7 +71,7 @@ describe Deimos::ActiveRecordProducer do
71
71
  before(:each) do
72
72
  Deimos.configure do |config|
73
73
  config.schema.use_schema_classes = use_schema_classes
74
- config.schema.generate_namespace_folders = true
74
+ config.schema.use_full_namespace = true
75
75
  end
76
76
  end
77
77
 
@@ -42,7 +42,7 @@ module ConsumerTest
42
42
  before(:each) do
43
43
  Deimos.configure do |config|
44
44
  config.schema.use_schema_classes = use_schema_classes
45
- config.schema.generate_namespace_folders = true
45
+ config.schema.use_full_namespace = true
46
46
  end
47
47
  end
48
48
 
@@ -31,7 +31,7 @@ module ConsumerTest
31
31
  before(:each) do
32
32
  Deimos.configure do |config|
33
33
  config.schema.use_schema_classes = use_schema_classes
34
- config.schema.generate_namespace_folders = true
34
+ config.schema.use_full_namespace = true
35
35
  end
36
36
  end
37
37
 
@@ -138,7 +138,7 @@ module ConsumerTest
138
138
  before(:each) do
139
139
  Deimos.configure do |config|
140
140
  config.schema.use_schema_classes = true
141
- config.schema.generate_namespace_folders = true
141
+ config.schema.use_full_namespace = true
142
142
  end
143
143
  end
144
144
 
@@ -217,13 +217,30 @@ RSpec.describe Deimos::Generators::SchemaClassGenerator do
217
217
 
218
218
  context 'with namespace folders' do
219
219
  it 'should generate the correct classes' do
220
- Deimos.with_config('schema.generate_namespace_folders' => true) do
220
+ Deimos.with_config('schema.use_full_namespace' => true) do
221
221
  described_class.start
222
222
  expect(files).to match_snapshot('namespace_folders', snapshot_serializer: MultiFileSerializer)
223
223
  end
224
224
  end
225
225
  end
226
226
 
227
+ context 'with namespace map' do
228
+ it 'should generate the correct classes' do
229
+ Deimos.with_config(
230
+ {
231
+ 'schema.use_full_namespace' => true,
232
+ 'schema.schema_namespace_map' => {
233
+ 'com' => 'Schemas',
234
+ 'com.my-namespace.my-suborg' => %w(Schemas MyNamespace)
235
+ }
236
+ }
237
+ ) do
238
+ described_class.start
239
+ expect(files).to match_snapshot('namespace_map', snapshot_serializer: MultiFileSerializer)
240
+ end
241
+ end
242
+ end
243
+
227
244
  context 'nested true' do
228
245
  it 'should generate the correct classes' do
229
246
  Deimos.with_config('schema.nest_child_schemas' => true) do
@@ -0,0 +1,18 @@
1
+ {
2
+ "namespace": "com.my-namespace.my-suborg",
3
+ "name": "MyLongNamespaceSchema",
4
+ "type": "record",
5
+ "doc": "Test schema",
6
+ "fields": [
7
+ {
8
+ "name": "test_id",
9
+ "type": "string",
10
+ "doc": "test string"
11
+ },
12
+ {
13
+ "name": "some_int",
14
+ "type": "int",
15
+ "doc": "test int"
16
+ }
17
+ ]
18
+ }
@@ -128,7 +128,7 @@ module Schemas; module MyNamespace
128
128
  end
129
129
 
130
130
  def self.tombstone(key)
131
- record = self.new
131
+ record = self.allocate
132
132
  record.tombstone_key = key
133
133
  record.a_string = key
134
134
  record
@@ -0,0 +1,48 @@
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.my-suborg.MyLongNamespaceSchema
7
+ class MyLongNamespaceSchema < Deimos::SchemaClass::Record
8
+
9
+ ### Attribute Accessors ###
10
+ # @return [String]
11
+ attr_accessor :test_id
12
+ # @return [Integer]
13
+ attr_accessor :some_int
14
+
15
+ # @override
16
+ def initialize(test_id: nil,
17
+ some_int: nil)
18
+ super
19
+ self.test_id = test_id
20
+ self.some_int = some_int
21
+ end
22
+
23
+ # @override
24
+ def schema
25
+ 'MyLongNamespaceSchema'
26
+ end
27
+
28
+ # @override
29
+ def namespace
30
+ 'com.my-namespace.my-suborg'
31
+ end
32
+
33
+ def self.tombstone(key)
34
+ record = self.allocate
35
+ record.tombstone_key = key
36
+ record.test_id = key
37
+ record
38
+ end
39
+
40
+ # @override
41
+ def as_json(_opts={})
42
+ {
43
+ 'test_id' => @test_id,
44
+ 'some_int' => @some_int
45
+ }
46
+ end
47
+ end
48
+ end; end
@@ -104,7 +104,7 @@ module Schemas; module MyNamespace
104
104
  end
105
105
 
106
106
  def self.tombstone(key)
107
- record = self.new
107
+ record = self.allocate
108
108
  record.tombstone_key = key
109
109
  record.test_id = key
110
110
  record
@@ -43,7 +43,7 @@ module Schemas; module MyNamespace
43
43
  end
44
44
 
45
45
  def self.tombstone(key)
46
- record = self.new
46
+ record = self.allocate
47
47
  record.tombstone_key = MySchemaKey.initialize_from_value(key)
48
48
  record.payload_key = key
49
49
  record
@@ -68,7 +68,7 @@ module Schemas; module MyNamespace
68
68
  end
69
69
 
70
70
  def self.tombstone(key)
71
- record = self.new
71
+ record = self.allocate
72
72
  record
73
73
  end
74
74
 
@@ -9,7 +9,7 @@ module Schemas; module MyNamespace
9
9
  ### Secondary Schema Classes ###
10
10
  # Autogenerated Schema for Record at com.my-namespace.ARecord
11
11
  class ARecord < Deimos::SchemaClass::Record
12
-
12
+
13
13
  ### Attribute Accessors ###
14
14
  # @return [String]
15
15
  attr_accessor :a_record_field
@@ -185,7 +185,7 @@ module Schemas; module MyNamespace
185
185
  end
186
186
 
187
187
  def self.tombstone(key)
188
- record = self.new
188
+ record = self.allocate
189
189
  record.tombstone_key = key
190
190
  record.test_id = key
191
191
  record
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas; module MyNamespace
4
+ module Schemas; module Com; module MyNamespace
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.MySchema
7
7
  class MyUpdatedSchema < Schemas::MyNamespace::MySchema
@@ -16,3 +16,4 @@ module Schemas; module MyNamespace
16
16
  end
17
17
  end
18
18
  end
19
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas; module Request
4
+ module Schemas; module MyNamespace; module Request
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.request.CreateTopic
7
7
  class CreateTopic < Deimos::SchemaClass::Record
@@ -33,4 +33,4 @@ module Schemas; module Request
33
33
  }
34
34
  end
35
35
  end
36
- end; end
36
+ end; end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas; module Request
4
+ module Schemas; module MyNamespace; module Request
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.request.Index
7
7
  class Index < Deimos::SchemaClass::Record
@@ -33,4 +33,4 @@ module Schemas; module Request
33
33
  }
34
34
  end
35
35
  end
36
- end; end
36
+ end; end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas; module Request
4
+ module Schemas; module MyNamespace; module Request
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.request.UpdateRequest
7
7
  class UpdateRequest < Deimos::SchemaClass::Record
@@ -33,4 +33,4 @@ module Schemas; module Request
33
33
  }
34
34
  end
35
35
  end
36
- end; end
36
+ end; end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas; module Response
4
+ module Schemas; module MyNamespace; module Response
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.response.CreateTopic
7
7
  class CreateTopic < Deimos::SchemaClass::Record
@@ -33,4 +33,4 @@ module Schemas; module Response
33
33
  }
34
34
  end
35
35
  end
36
- end; end
36
+ end; end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas; module Response
4
+ module Schemas; module MyNamespace; module Response
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.response.Index
7
7
  class Index < Deimos::SchemaClass::Record
@@ -33,4 +33,4 @@ module Schemas; module Response
33
33
  }
34
34
  end
35
35
  end
36
- end; end
36
+ end; end; end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is autogenerated by Deimos, Do NOT modify
4
- module Schemas; module Response
4
+ module Schemas; module MyNamespace; module Response
5
5
  ### Primary Schema Class ###
6
6
  # Autogenerated Schema for Record at com.my-namespace.response.UpdateResponse
7
7
  class UpdateResponse < Deimos::SchemaClass::Record
@@ -33,4 +33,4 @@ module Schemas; module Response
33
33
  }
34
34
  end
35
35
  end
36
- end; end
36
+ end; end; end
@@ -267,6 +267,50 @@ module Schemas
267
267
  end
268
268
 
269
269
 
270
+ spec/app/lib/schema_classes/my_long_namespace_schema.rb:
271
+ # frozen_string_literal: true
272
+
273
+ # This file is autogenerated by Deimos, Do NOT modify
274
+ module Schemas
275
+ ### Primary Schema Class ###
276
+ # Autogenerated Schema for Record at com.my-namespace.my-suborg.MyLongNamespaceSchema
277
+ class MyLongNamespaceSchema < Deimos::SchemaClass::Record
278
+
279
+ ### Attribute Accessors ###
280
+ # @return [String]
281
+ attr_accessor :test_id
282
+ # @return [Integer]
283
+ attr_accessor :some_int
284
+
285
+ # @override
286
+ def initialize(test_id: nil,
287
+ some_int: nil)
288
+ super
289
+ self.test_id = test_id
290
+ self.some_int = some_int
291
+ end
292
+
293
+ # @override
294
+ def schema
295
+ 'MyLongNamespaceSchema'
296
+ end
297
+
298
+ # @override
299
+ def namespace
300
+ 'com.my-namespace.my-suborg'
301
+ end
302
+
303
+ # @override
304
+ def as_json(_opts={})
305
+ {
306
+ 'test_id' => @test_id,
307
+ 'some_int' => @some_int
308
+ }
309
+ end
310
+ end
311
+ end
312
+
313
+
270
314
  spec/app/lib/schema_classes/my_nested_record.rb:
271
315
  # frozen_string_literal: true
272
316
 
@@ -234,6 +234,50 @@ module Schemas
234
234
  end
235
235
 
236
236
 
237
+ spec/app/lib/schema_classes/my_long_namespace_schema.rb:
238
+ # frozen_string_literal: true
239
+
240
+ # This file is autogenerated by Deimos, Do NOT modify
241
+ module Schemas
242
+ ### Primary Schema Class ###
243
+ # Autogenerated Schema for Record at com.my-namespace.my-suborg.MyLongNamespaceSchema
244
+ class MyLongNamespaceSchema < Deimos::SchemaClass::Record
245
+
246
+ ### Attribute Accessors ###
247
+ # @return [String]
248
+ attr_accessor :test_id
249
+ # @return [Integer]
250
+ attr_accessor :some_int
251
+
252
+ # @override
253
+ def initialize(test_id: nil,
254
+ some_int: nil)
255
+ super
256
+ self.test_id = test_id
257
+ self.some_int = some_int
258
+ end
259
+
260
+ # @override
261
+ def schema
262
+ 'MyLongNamespaceSchema'
263
+ end
264
+
265
+ # @override
266
+ def namespace
267
+ 'com.my-namespace.my-suborg'
268
+ end
269
+
270
+ # @override
271
+ def as_json(_opts={})
272
+ {
273
+ 'test_id' => @test_id,
274
+ 'some_int' => @some_int
275
+ }
276
+ end
277
+ end
278
+ end
279
+
280
+
237
281
  spec/app/lib/schema_classes/my_nested_schema.rb:
238
282
  # frozen_string_literal: true
239
283
 
@@ -267,6 +267,50 @@ module Schemas
267
267
  end
268
268
 
269
269
 
270
+ spec/app/lib/schema_classes/my_long_namespace_schema.rb:
271
+ # frozen_string_literal: true
272
+
273
+ # This file is autogenerated by Deimos, Do NOT modify
274
+ module Schemas
275
+ ### Primary Schema Class ###
276
+ # Autogenerated Schema for Record at com.my-namespace.my-suborg.MyLongNamespaceSchema
277
+ class MyLongNamespaceSchema < Deimos::SchemaClass::Record
278
+
279
+ ### Attribute Accessors ###
280
+ # @return [String]
281
+ attr_accessor :test_id
282
+ # @return [Integer]
283
+ attr_accessor :some_int
284
+
285
+ # @override
286
+ def initialize(test_id: nil,
287
+ some_int: nil)
288
+ super
289
+ self.test_id = test_id
290
+ self.some_int = some_int
291
+ end
292
+
293
+ # @override
294
+ def schema
295
+ 'MyLongNamespaceSchema'
296
+ end
297
+
298
+ # @override
299
+ def namespace
300
+ 'com.my-namespace.my-suborg'
301
+ end
302
+
303
+ # @override
304
+ def as_json(_opts={})
305
+ {
306
+ 'test_id' => @test_id,
307
+ 'some_int' => @some_int
308
+ }
309
+ end
310
+ end
311
+ end
312
+
313
+
270
314
  spec/app/lib/schema_classes/my_nested_record.rb:
271
315
  # frozen_string_literal: true
272
316