deimos-ruby 1.24.3 → 2.0.0.pre.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +0 -17
  3. data/.tool-versions +1 -0
  4. data/CHANGELOG.md +1 -1
  5. data/README.md +287 -498
  6. data/deimos-ruby.gemspec +4 -4
  7. data/docs/CONFIGURATION.md +133 -227
  8. data/docs/UPGRADING.md +237 -0
  9. data/lib/deimos/active_record_consume/batch_consumption.rb +28 -29
  10. data/lib/deimos/active_record_consume/message_consumption.rb +15 -21
  11. data/lib/deimos/active_record_consumer.rb +36 -26
  12. data/lib/deimos/active_record_producer.rb +28 -9
  13. data/lib/deimos/backends/base.rb +4 -35
  14. data/lib/deimos/backends/kafka.rb +6 -22
  15. data/lib/deimos/backends/kafka_async.rb +6 -22
  16. data/lib/deimos/backends/{db.rb → outbox.rb} +13 -9
  17. data/lib/deimos/config/configuration.rb +116 -385
  18. data/lib/deimos/consume/batch_consumption.rb +24 -124
  19. data/lib/deimos/consume/message_consumption.rb +36 -63
  20. data/lib/deimos/consumer.rb +16 -75
  21. data/lib/deimos/ext/consumer_route.rb +35 -0
  22. data/lib/deimos/ext/producer_middleware.rb +94 -0
  23. data/lib/deimos/ext/producer_route.rb +22 -0
  24. data/lib/deimos/ext/redraw.rb +29 -0
  25. data/lib/deimos/ext/routing_defaults.rb +72 -0
  26. data/lib/deimos/ext/schema_route.rb +70 -0
  27. data/lib/deimos/kafka_message.rb +2 -2
  28. data/lib/deimos/kafka_source.rb +2 -7
  29. data/lib/deimos/kafka_topic_info.rb +1 -1
  30. data/lib/deimos/logging.rb +71 -0
  31. data/lib/deimos/message.rb +2 -11
  32. data/lib/deimos/metrics/datadog.rb +40 -1
  33. data/lib/deimos/metrics/provider.rb +4 -4
  34. data/lib/deimos/producer.rb +39 -116
  35. data/lib/deimos/railtie.rb +6 -0
  36. data/lib/deimos/schema_backends/avro_base.rb +21 -21
  37. data/lib/deimos/schema_backends/avro_schema_registry.rb +1 -2
  38. data/lib/deimos/schema_backends/avro_validation.rb +2 -2
  39. data/lib/deimos/schema_backends/base.rb +19 -12
  40. data/lib/deimos/schema_backends/mock.rb +6 -1
  41. data/lib/deimos/schema_backends/plain.rb +47 -0
  42. data/lib/deimos/schema_class/base.rb +2 -2
  43. data/lib/deimos/schema_class/enum.rb +1 -1
  44. data/lib/deimos/schema_class/record.rb +2 -2
  45. data/lib/deimos/test_helpers.rb +95 -320
  46. data/lib/deimos/tracing/provider.rb +6 -6
  47. data/lib/deimos/transcoder.rb +88 -0
  48. data/lib/deimos/utils/db_poller/base.rb +16 -14
  49. data/lib/deimos/utils/db_poller/state_based.rb +3 -3
  50. data/lib/deimos/utils/db_poller/time_based.rb +4 -4
  51. data/lib/deimos/utils/db_poller.rb +1 -1
  52. data/lib/deimos/utils/deadlock_retry.rb +1 -1
  53. data/lib/deimos/utils/{db_producer.rb → outbox_producer.rb} +16 -47
  54. data/lib/deimos/utils/schema_class.rb +0 -7
  55. data/lib/deimos/version.rb +1 -1
  56. data/lib/deimos.rb +79 -26
  57. data/lib/generators/deimos/{db_backend_generator.rb → outbox_backend_generator.rb} +4 -4
  58. data/lib/generators/deimos/schema_class_generator.rb +0 -1
  59. data/lib/generators/deimos/v2/templates/karafka.rb.tt +149 -0
  60. data/lib/generators/deimos/v2_generator.rb +193 -0
  61. data/lib/tasks/deimos.rake +5 -7
  62. data/spec/active_record_batch_consumer_association_spec.rb +22 -13
  63. data/spec/active_record_batch_consumer_spec.rb +84 -65
  64. data/spec/active_record_consume/batch_consumption_spec.rb +10 -10
  65. data/spec/active_record_consume/batch_slicer_spec.rb +12 -12
  66. data/spec/active_record_consumer_spec.rb +29 -13
  67. data/spec/active_record_producer_spec.rb +36 -26
  68. data/spec/backends/base_spec.rb +0 -23
  69. data/spec/backends/kafka_async_spec.rb +1 -3
  70. data/spec/backends/kafka_spec.rb +1 -3
  71. data/spec/backends/{db_spec.rb → outbox_spec.rb} +14 -20
  72. data/spec/batch_consumer_spec.rb +66 -116
  73. data/spec/consumer_spec.rb +53 -147
  74. data/spec/deimos_spec.rb +10 -126
  75. data/spec/kafka_source_spec.rb +19 -52
  76. data/spec/karafka/karafka.rb +69 -0
  77. data/spec/karafka_config/karafka_spec.rb +97 -0
  78. data/spec/logging_spec.rb +25 -0
  79. data/spec/message_spec.rb +9 -9
  80. data/spec/producer_spec.rb +112 -254
  81. data/spec/rake_spec.rb +1 -3
  82. data/spec/schema_backends/avro_validation_spec.rb +1 -1
  83. data/spec/schemas/com/my-namespace/MySchemaWithTitle.avsc +22 -0
  84. data/spec/snapshots/consumers-no-nest.snap +49 -0
  85. data/spec/snapshots/consumers.snap +49 -0
  86. data/spec/snapshots/consumers_and_producers-no-nest.snap +49 -0
  87. data/spec/snapshots/consumers_and_producers.snap +49 -0
  88. data/spec/snapshots/consumers_circular-no-nest.snap +49 -0
  89. data/spec/snapshots/consumers_circular.snap +49 -0
  90. data/spec/snapshots/consumers_complex_types-no-nest.snap +49 -0
  91. data/spec/snapshots/consumers_complex_types.snap +49 -0
  92. data/spec/snapshots/consumers_nested-no-nest.snap +49 -0
  93. data/spec/snapshots/consumers_nested.snap +49 -0
  94. data/spec/snapshots/namespace_folders.snap +49 -0
  95. data/spec/snapshots/namespace_map.snap +49 -0
  96. data/spec/snapshots/producers_with_key-no-nest.snap +49 -0
  97. data/spec/snapshots/producers_with_key.snap +49 -0
  98. data/spec/spec_helper.rb +61 -29
  99. data/spec/utils/db_poller_spec.rb +49 -39
  100. data/spec/utils/{db_producer_spec.rb → outbox_producer_spec.rb} +17 -184
  101. metadata +58 -67
  102. data/lib/deimos/batch_consumer.rb +0 -7
  103. data/lib/deimos/config/phobos_config.rb +0 -164
  104. data/lib/deimos/instrumentation.rb +0 -95
  105. data/lib/deimos/monkey_patches/phobos_cli.rb +0 -35
  106. data/lib/deimos/utils/inline_consumer.rb +0 -158
  107. data/lib/deimos/utils/lag_reporter.rb +0 -186
  108. data/lib/deimos/utils/schema_controller_mixin.rb +0 -129
  109. data/spec/config/configuration_spec.rb +0 -329
  110. data/spec/kafka_listener_spec.rb +0 -55
  111. data/spec/phobos.bad_db.yml +0 -73
  112. data/spec/phobos.yml +0 -77
  113. data/spec/utils/inline_consumer_spec.rb +0 -31
  114. data/spec/utils/lag_reporter_spec.rb +0 -76
  115. data/spec/utils/platform_schema_validation_spec.rb +0 -0
  116. data/spec/utils/schema_controller_mixin_spec.rb +0 -84
  117. /data/lib/generators/deimos/{db_backend → outbox_backend}/templates/migration +0 -0
  118. /data/lib/generators/deimos/{db_backend → outbox_backend}/templates/rails3_migration +0 -0
@@ -977,6 +977,55 @@ module Schemas
977
977
  end
978
978
 
979
979
 
980
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
981
+ # frozen_string_literal: true
982
+
983
+ # This file is autogenerated by Deimos, Do NOT modify
984
+ module Schemas
985
+ ### Primary Schema Class ###
986
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
987
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
988
+
989
+ ### Attribute Accessors ###
990
+ # @return [String]
991
+ attr_accessor :test_id
992
+ # @return [Integer]
993
+ attr_accessor :some_int
994
+ # @return [String]
995
+ attr_accessor :title
996
+
997
+ # @override
998
+ def initialize(test_id: nil,
999
+ some_int: nil,
1000
+ title: nil)
1001
+ super
1002
+ self.test_id = test_id
1003
+ self.some_int = some_int
1004
+ self.title = title
1005
+ end
1006
+
1007
+ # @override
1008
+ def schema
1009
+ 'MySchemaWithTitle'
1010
+ end
1011
+
1012
+ # @override
1013
+ def namespace
1014
+ 'com.my-namespace'
1015
+ end
1016
+
1017
+ # @override
1018
+ def as_json(_opts={})
1019
+ {
1020
+ 'test_id' => @test_id,
1021
+ 'some_int' => @some_int,
1022
+ 'title' => @title
1023
+ }
1024
+ end
1025
+ end
1026
+ end
1027
+
1028
+
980
1029
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
981
1030
  # frozen_string_literal: true
982
1031
 
@@ -1037,6 +1037,55 @@ module Schemas
1037
1037
  end
1038
1038
 
1039
1039
 
1040
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
1041
+ # frozen_string_literal: true
1042
+
1043
+ # This file is autogenerated by Deimos, Do NOT modify
1044
+ module Schemas
1045
+ ### Primary Schema Class ###
1046
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
1047
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
1048
+
1049
+ ### Attribute Accessors ###
1050
+ # @return [String]
1051
+ attr_accessor :test_id
1052
+ # @return [Integer]
1053
+ attr_accessor :some_int
1054
+ # @return [String]
1055
+ attr_accessor :title
1056
+
1057
+ # @override
1058
+ def initialize(test_id: nil,
1059
+ some_int: nil,
1060
+ title: nil)
1061
+ super
1062
+ self.test_id = test_id
1063
+ self.some_int = some_int
1064
+ self.title = title
1065
+ end
1066
+
1067
+ # @override
1068
+ def schema
1069
+ 'MySchemaWithTitle'
1070
+ end
1071
+
1072
+ # @override
1073
+ def namespace
1074
+ 'com.my-namespace'
1075
+ end
1076
+
1077
+ # @override
1078
+ def as_json(_opts={})
1079
+ {
1080
+ 'test_id' => @test_id,
1081
+ 'some_int' => @some_int,
1082
+ 'title' => @title
1083
+ }
1084
+ end
1085
+ end
1086
+ end
1087
+
1088
+
1040
1089
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
1041
1090
  # frozen_string_literal: true
1042
1091
 
@@ -950,6 +950,55 @@ module Schemas
950
950
  end
951
951
 
952
952
 
953
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
954
+ # frozen_string_literal: true
955
+
956
+ # This file is autogenerated by Deimos, Do NOT modify
957
+ module Schemas
958
+ ### Primary Schema Class ###
959
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
960
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
961
+
962
+ ### Attribute Accessors ###
963
+ # @return [String]
964
+ attr_accessor :test_id
965
+ # @return [Integer]
966
+ attr_accessor :some_int
967
+ # @return [String]
968
+ attr_accessor :title
969
+
970
+ # @override
971
+ def initialize(test_id: nil,
972
+ some_int: nil,
973
+ title: nil)
974
+ super
975
+ self.test_id = test_id
976
+ self.some_int = some_int
977
+ self.title = title
978
+ end
979
+
980
+ # @override
981
+ def schema
982
+ 'MySchemaWithTitle'
983
+ end
984
+
985
+ # @override
986
+ def namespace
987
+ 'com.my-namespace'
988
+ end
989
+
990
+ # @override
991
+ def as_json(_opts={})
992
+ {
993
+ 'test_id' => @test_id,
994
+ 'some_int' => @some_int,
995
+ 'title' => @title
996
+ }
997
+ end
998
+ end
999
+ end
1000
+
1001
+
953
1002
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
954
1003
  # frozen_string_literal: true
955
1004
 
@@ -1010,6 +1010,55 @@ module Schemas
1010
1010
  end
1011
1011
 
1012
1012
 
1013
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
1014
+ # frozen_string_literal: true
1015
+
1016
+ # This file is autogenerated by Deimos, Do NOT modify
1017
+ module Schemas
1018
+ ### Primary Schema Class ###
1019
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
1020
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
1021
+
1022
+ ### Attribute Accessors ###
1023
+ # @return [String]
1024
+ attr_accessor :test_id
1025
+ # @return [Integer]
1026
+ attr_accessor :some_int
1027
+ # @return [String]
1028
+ attr_accessor :title
1029
+
1030
+ # @override
1031
+ def initialize(test_id: nil,
1032
+ some_int: nil,
1033
+ title: nil)
1034
+ super
1035
+ self.test_id = test_id
1036
+ self.some_int = some_int
1037
+ self.title = title
1038
+ end
1039
+
1040
+ # @override
1041
+ def schema
1042
+ 'MySchemaWithTitle'
1043
+ end
1044
+
1045
+ # @override
1046
+ def namespace
1047
+ 'com.my-namespace'
1048
+ end
1049
+
1050
+ # @override
1051
+ def as_json(_opts={})
1052
+ {
1053
+ 'test_id' => @test_id,
1054
+ 'some_int' => @some_int,
1055
+ 'title' => @title
1056
+ }
1057
+ end
1058
+ end
1059
+ end
1060
+
1061
+
1013
1062
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
1014
1063
  # frozen_string_literal: true
1015
1064
 
@@ -950,6 +950,55 @@ module Schemas
950
950
  end
951
951
 
952
952
 
953
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
954
+ # frozen_string_literal: true
955
+
956
+ # This file is autogenerated by Deimos, Do NOT modify
957
+ module Schemas
958
+ ### Primary Schema Class ###
959
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
960
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
961
+
962
+ ### Attribute Accessors ###
963
+ # @return [String]
964
+ attr_accessor :test_id
965
+ # @return [Integer]
966
+ attr_accessor :some_int
967
+ # @return [String]
968
+ attr_accessor :title
969
+
970
+ # @override
971
+ def initialize(test_id: nil,
972
+ some_int: nil,
973
+ title: nil)
974
+ super
975
+ self.test_id = test_id
976
+ self.some_int = some_int
977
+ self.title = title
978
+ end
979
+
980
+ # @override
981
+ def schema
982
+ 'MySchemaWithTitle'
983
+ end
984
+
985
+ # @override
986
+ def namespace
987
+ 'com.my-namespace'
988
+ end
989
+
990
+ # @override
991
+ def as_json(_opts={})
992
+ {
993
+ 'test_id' => @test_id,
994
+ 'some_int' => @some_int,
995
+ 'title' => @title
996
+ }
997
+ end
998
+ end
999
+ end
1000
+
1001
+
953
1002
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
954
1003
  # frozen_string_literal: true
955
1004
 
@@ -1010,6 +1010,55 @@ module Schemas
1010
1010
  end
1011
1011
 
1012
1012
 
1013
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
1014
+ # frozen_string_literal: true
1015
+
1016
+ # This file is autogenerated by Deimos, Do NOT modify
1017
+ module Schemas
1018
+ ### Primary Schema Class ###
1019
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
1020
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
1021
+
1022
+ ### Attribute Accessors ###
1023
+ # @return [String]
1024
+ attr_accessor :test_id
1025
+ # @return [Integer]
1026
+ attr_accessor :some_int
1027
+ # @return [String]
1028
+ attr_accessor :title
1029
+
1030
+ # @override
1031
+ def initialize(test_id: nil,
1032
+ some_int: nil,
1033
+ title: nil)
1034
+ super
1035
+ self.test_id = test_id
1036
+ self.some_int = some_int
1037
+ self.title = title
1038
+ end
1039
+
1040
+ # @override
1041
+ def schema
1042
+ 'MySchemaWithTitle'
1043
+ end
1044
+
1045
+ # @override
1046
+ def namespace
1047
+ 'com.my-namespace'
1048
+ end
1049
+
1050
+ # @override
1051
+ def as_json(_opts={})
1052
+ {
1053
+ 'test_id' => @test_id,
1054
+ 'some_int' => @some_int,
1055
+ 'title' => @title
1056
+ }
1057
+ end
1058
+ end
1059
+ end
1060
+
1061
+
1013
1062
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
1014
1063
  # frozen_string_literal: true
1015
1064
 
@@ -950,6 +950,55 @@ module Schemas
950
950
  end
951
951
 
952
952
 
953
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
954
+ # frozen_string_literal: true
955
+
956
+ # This file is autogenerated by Deimos, Do NOT modify
957
+ module Schemas
958
+ ### Primary Schema Class ###
959
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
960
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
961
+
962
+ ### Attribute Accessors ###
963
+ # @return [String]
964
+ attr_accessor :test_id
965
+ # @return [Integer]
966
+ attr_accessor :some_int
967
+ # @return [String]
968
+ attr_accessor :title
969
+
970
+ # @override
971
+ def initialize(test_id: nil,
972
+ some_int: nil,
973
+ title: nil)
974
+ super
975
+ self.test_id = test_id
976
+ self.some_int = some_int
977
+ self.title = title
978
+ end
979
+
980
+ # @override
981
+ def schema
982
+ 'MySchemaWithTitle'
983
+ end
984
+
985
+ # @override
986
+ def namespace
987
+ 'com.my-namespace'
988
+ end
989
+
990
+ # @override
991
+ def as_json(_opts={})
992
+ {
993
+ 'test_id' => @test_id,
994
+ 'some_int' => @some_int,
995
+ 'title' => @title
996
+ }
997
+ end
998
+ end
999
+ end
1000
+
1001
+
953
1002
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
954
1003
  # frozen_string_literal: true
955
1004
 
@@ -1010,6 +1010,55 @@ module Schemas
1010
1010
  end
1011
1011
 
1012
1012
 
1013
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
1014
+ # frozen_string_literal: true
1015
+
1016
+ # This file is autogenerated by Deimos, Do NOT modify
1017
+ module Schemas
1018
+ ### Primary Schema Class ###
1019
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
1020
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
1021
+
1022
+ ### Attribute Accessors ###
1023
+ # @return [String]
1024
+ attr_accessor :test_id
1025
+ # @return [Integer]
1026
+ attr_accessor :some_int
1027
+ # @return [String]
1028
+ attr_accessor :title
1029
+
1030
+ # @override
1031
+ def initialize(test_id: nil,
1032
+ some_int: nil,
1033
+ title: nil)
1034
+ super
1035
+ self.test_id = test_id
1036
+ self.some_int = some_int
1037
+ self.title = title
1038
+ end
1039
+
1040
+ # @override
1041
+ def schema
1042
+ 'MySchemaWithTitle'
1043
+ end
1044
+
1045
+ # @override
1046
+ def namespace
1047
+ 'com.my-namespace'
1048
+ end
1049
+
1050
+ # @override
1051
+ def as_json(_opts={})
1052
+ {
1053
+ 'test_id' => @test_id,
1054
+ 'some_int' => @some_int,
1055
+ 'title' => @title
1056
+ }
1057
+ end
1058
+ end
1059
+ end
1060
+
1061
+
1013
1062
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
1014
1063
  # frozen_string_literal: true
1015
1064
 
@@ -915,6 +915,55 @@ module Schemas; module Com; module MyNamespace
915
915
  end; end; end
916
916
 
917
917
 
918
+ spec/app/lib/schema_classes/schemas/com/my_namespace/my_schema_with_title.rb:
919
+ # frozen_string_literal: true
920
+
921
+ # This file is autogenerated by Deimos, Do NOT modify
922
+ module Schemas; module Com; module MyNamespace
923
+ ### Primary Schema Class ###
924
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
925
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
926
+
927
+ ### Attribute Accessors ###
928
+ # @return [String]
929
+ attr_accessor :test_id
930
+ # @return [Integer]
931
+ attr_accessor :some_int
932
+ # @return [String]
933
+ attr_accessor :title
934
+
935
+ # @override
936
+ def initialize(test_id: nil,
937
+ some_int: nil,
938
+ title: nil)
939
+ super
940
+ self.test_id = test_id
941
+ self.some_int = some_int
942
+ self.title = title
943
+ end
944
+
945
+ # @override
946
+ def schema
947
+ 'MySchemaWithTitle'
948
+ end
949
+
950
+ # @override
951
+ def namespace
952
+ 'com.my-namespace'
953
+ end
954
+
955
+ # @override
956
+ def as_json(_opts={})
957
+ {
958
+ 'test_id' => @test_id,
959
+ 'some_int' => @some_int,
960
+ 'title' => @title
961
+ }
962
+ end
963
+ end
964
+ end; end; end
965
+
966
+
918
967
  spec/app/lib/schema_classes/schemas/com/my_namespace/my_schema_with_unique_id.rb:
919
968
  # frozen_string_literal: true
920
969
 
@@ -959,6 +959,55 @@ module Schemas; module MyNamespace
959
959
  end; end
960
960
 
961
961
 
962
+ spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_title.rb:
963
+ # frozen_string_literal: true
964
+
965
+ # This file is autogenerated by Deimos, Do NOT modify
966
+ module Schemas; module MyNamespace
967
+ ### Primary Schema Class ###
968
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
969
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
970
+
971
+ ### Attribute Accessors ###
972
+ # @return [String]
973
+ attr_accessor :test_id
974
+ # @return [Integer]
975
+ attr_accessor :some_int
976
+ # @return [String]
977
+ attr_accessor :title
978
+
979
+ # @override
980
+ def initialize(test_id: nil,
981
+ some_int: nil,
982
+ title: nil)
983
+ super
984
+ self.test_id = test_id
985
+ self.some_int = some_int
986
+ self.title = title
987
+ end
988
+
989
+ # @override
990
+ def schema
991
+ 'MySchemaWithTitle'
992
+ end
993
+
994
+ # @override
995
+ def namespace
996
+ 'com.my-namespace'
997
+ end
998
+
999
+ # @override
1000
+ def as_json(_opts={})
1001
+ {
1002
+ 'test_id' => @test_id,
1003
+ 'some_int' => @some_int,
1004
+ 'title' => @title
1005
+ }
1006
+ end
1007
+ end
1008
+ end; end
1009
+
1010
+
962
1011
  spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_unique_id.rb:
963
1012
  # frozen_string_literal: true
964
1013
 
@@ -963,6 +963,55 @@ module Schemas
963
963
  end
964
964
 
965
965
 
966
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
967
+ # frozen_string_literal: true
968
+
969
+ # This file is autogenerated by Deimos, Do NOT modify
970
+ module Schemas
971
+ ### Primary Schema Class ###
972
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
973
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
974
+
975
+ ### Attribute Accessors ###
976
+ # @return [String]
977
+ attr_accessor :test_id
978
+ # @return [Integer]
979
+ attr_accessor :some_int
980
+ # @return [String]
981
+ attr_accessor :title
982
+
983
+ # @override
984
+ def initialize(test_id: nil,
985
+ some_int: nil,
986
+ title: nil)
987
+ super
988
+ self.test_id = test_id
989
+ self.some_int = some_int
990
+ self.title = title
991
+ end
992
+
993
+ # @override
994
+ def schema
995
+ 'MySchemaWithTitle'
996
+ end
997
+
998
+ # @override
999
+ def namespace
1000
+ 'com.my-namespace'
1001
+ end
1002
+
1003
+ # @override
1004
+ def as_json(_opts={})
1005
+ {
1006
+ 'test_id' => @test_id,
1007
+ 'some_int' => @some_int,
1008
+ 'title' => @title
1009
+ }
1010
+ end
1011
+ end
1012
+ end
1013
+
1014
+
966
1015
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
967
1016
  # frozen_string_literal: true
968
1017
 
@@ -1023,6 +1023,55 @@ module Schemas
1023
1023
  end
1024
1024
 
1025
1025
 
1026
+ spec/app/lib/schema_classes/my_schema_with_title.rb:
1027
+ # frozen_string_literal: true
1028
+
1029
+ # This file is autogenerated by Deimos, Do NOT modify
1030
+ module Schemas
1031
+ ### Primary Schema Class ###
1032
+ # Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
1033
+ class MySchemaWithTitle < Deimos::SchemaClass::Record
1034
+
1035
+ ### Attribute Accessors ###
1036
+ # @return [String]
1037
+ attr_accessor :test_id
1038
+ # @return [Integer]
1039
+ attr_accessor :some_int
1040
+ # @return [String]
1041
+ attr_accessor :title
1042
+
1043
+ # @override
1044
+ def initialize(test_id: nil,
1045
+ some_int: nil,
1046
+ title: nil)
1047
+ super
1048
+ self.test_id = test_id
1049
+ self.some_int = some_int
1050
+ self.title = title
1051
+ end
1052
+
1053
+ # @override
1054
+ def schema
1055
+ 'MySchemaWithTitle'
1056
+ end
1057
+
1058
+ # @override
1059
+ def namespace
1060
+ 'com.my-namespace'
1061
+ end
1062
+
1063
+ # @override
1064
+ def as_json(_opts={})
1065
+ {
1066
+ 'test_id' => @test_id,
1067
+ 'some_int' => @some_int,
1068
+ 'title' => @title
1069
+ }
1070
+ end
1071
+ end
1072
+ end
1073
+
1074
+
1026
1075
  spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
1027
1076
  # frozen_string_literal: true
1028
1077