deimos-ruby 1.12.6 → 1.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/deimos/schema_backends/avro_schema_registry.rb +2 -1
- data/lib/deimos/version.rb +1 -1
- data/lib/generators/deimos/schema_class_generator.rb +10 -3
- data/spec/generators/schema_class/my_schema_with_circular_reference_spec.rb +97 -0
- data/spec/generators/schema_class/my_schema_with_complex_types_spec.rb +5 -3
- data/spec/generators/schema_class_generator_spec.rb +26 -0
- data/spec/schema_classes/generated.rb +22 -22
- data/spec/schema_classes/my_schema_with_circular_reference.rb +74 -0
- data/spec/schema_classes/my_schema_with_complex_types.rb +66 -2
- data/spec/schemas/com/my-namespace/MySchemaWithCircularReference.avsc +39 -0
- data/spec/schemas/com/my-namespace/MySchemaWithComplexTypes.avsc +20 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f51b89a9bf8a619db4c9294092b5e7b4f78c075c35f4aa2bc39c547da99ec67c
|
4
|
+
data.tar.gz: e4da7d718fff36bb28ca249a788fbf78ad5f980e9fa32983ecf019cd53cd40b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ac325f814c79a29985cba298ef0cde7daa4b0c561ce155eee22dab15470b2c1a933f5baa0181fd9375500062fa89fc846dcb01504d10466645275fa3644ec53
|
7
|
+
data.tar.gz: 021dd749b7040b136f84fcc7142a207847a982e2ab889439486af4b5dc4267ed4eed25f4d71c9a6496c51d8e84f3bedc6220e3dbd1f0a0133bca8c8cc1fe24e5
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
+
# 1.13.2 - 2022-04-07
|
11
|
+
|
12
|
+
- Fix an issue with generating schema classes for schemas containing an enum with default value
|
13
|
+
|
14
|
+
# 1.13.1 - 2022-04-06
|
15
|
+
|
16
|
+
- Fix circular reference schema generation
|
17
|
+
|
18
|
+
# 1.13.0 - 2022-03-30
|
19
|
+
|
20
|
+
- Pass the Deimos logger to `AvroTurf::Messaging` for consistent logging
|
21
|
+
- Fix an issue with nullable enums not being included in the auto-generated schema class
|
22
|
+
|
10
23
|
# 1.12.6 - 2022-03-14
|
11
24
|
|
12
25
|
- Fix NameError when using Datadog Metrics
|
data/lib/deimos/version.rb
CHANGED
@@ -62,6 +62,8 @@ module Deimos
|
|
62
62
|
[schema.values]
|
63
63
|
elsif schema.respond_to?(:items)
|
64
64
|
[schema.items]
|
65
|
+
elsif schema.respond_to?(:schemas)
|
66
|
+
schema.schemas.reject { |s| s.class == Avro::Schema::PrimitiveSchema }
|
65
67
|
else
|
66
68
|
[]
|
67
69
|
end
|
@@ -71,17 +73,22 @@ module Deimos
|
|
71
73
|
# @return [Array<Avro::Schema::NamedSchema>]
|
72
74
|
def collect_all_schemas(schemas)
|
73
75
|
schemas.dup.each do |schema|
|
76
|
+
next if @discovered_schemas.include?(schema)
|
77
|
+
|
78
|
+
@discovered_schemas << schema
|
74
79
|
schemas.concat(collect_all_schemas(child_schemas(schema)))
|
75
80
|
end
|
81
|
+
|
76
82
|
schemas.select { |s| s.respond_to?(:name) }.uniq
|
77
83
|
end
|
78
84
|
|
79
85
|
# @param schema_base [Deimos::SchemaBackends::Base]
|
80
86
|
# @param key_schema_base[Avro::Schema::NamedSchema]
|
81
87
|
def generate_class_from_schema_base(schema_base, key_schema_base: nil)
|
88
|
+
@discovered_schemas = Set.new
|
82
89
|
schemas = collect_all_schemas(schema_base.schema_store.schemas.values)
|
83
90
|
|
84
|
-
sub_schemas = schemas.reject { |s| s.name == schema_base.schema }
|
91
|
+
sub_schemas = schemas.reject { |s| s.name == schema_base.schema }.sort_by(&:name)
|
85
92
|
@sub_schema_templates = sub_schemas.map do |schema|
|
86
93
|
_generate_class_template_from_schema(schema)
|
87
94
|
end
|
@@ -199,8 +206,8 @@ module Deimos
|
|
199
206
|
return ' nil' if default == :no_default || default.nil? || IGNORE_DEFAULTS.include?(field.name)
|
200
207
|
|
201
208
|
case field.type.type_sym
|
202
|
-
when :string
|
203
|
-
"
|
209
|
+
when :string, :enum
|
210
|
+
" \"#{default}\""
|
204
211
|
when :record
|
205
212
|
schema_name = Deimos::SchemaBackends::AvroBase.schema_classname(field.type)
|
206
213
|
class_instance = Utils::SchemaClass.instance(field.default, schema_name)
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# For testing the generated class.
|
4
|
+
RSpec.describe Schemas::MySchemaWithCircularReference do
|
5
|
+
let(:payload_hash) do
|
6
|
+
{
|
7
|
+
properties: {
|
8
|
+
a_boolean: {
|
9
|
+
property: true
|
10
|
+
},
|
11
|
+
an_integer: {
|
12
|
+
property: 1
|
13
|
+
},
|
14
|
+
a_float: {
|
15
|
+
property: 4.5
|
16
|
+
},
|
17
|
+
a_string: {
|
18
|
+
property: 'string'
|
19
|
+
},
|
20
|
+
an_array: {
|
21
|
+
property: [1, 2, 3]
|
22
|
+
},
|
23
|
+
an_hash: {
|
24
|
+
property: {
|
25
|
+
a_key: 'a_value'
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'class initialization' do
|
33
|
+
it 'should initialize the class from keyword arguments' do
|
34
|
+
klass = described_class.new(properties: payload_hash[:properties])
|
35
|
+
expect(klass).to be_instance_of(described_class)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should initialize the class from a hash with symbols as keys' do
|
39
|
+
klass = described_class.new(**payload_hash)
|
40
|
+
expect(klass).to be_instance_of(described_class)
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should initialize the class when missing attributes' do
|
44
|
+
payload_hash.delete(:properties)
|
45
|
+
klass = described_class.new(**payload_hash)
|
46
|
+
expect(klass).to be_instance_of(described_class)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
describe 'base class methods' do
|
52
|
+
let(:klass) do
|
53
|
+
described_class.new(**payload_hash)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should return the name of the schema and namespace' do
|
57
|
+
expect(klass.schema).to eq('MySchemaWithCircularReference')
|
58
|
+
expect(klass.namespace).to eq('com.my-namespace')
|
59
|
+
expect(klass.full_schema).to eq('com.my-namespace.MySchemaWithCircularReference')
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'should return a json version of the payload' do
|
63
|
+
described_class.new(**payload_hash)
|
64
|
+
payload_h = {
|
65
|
+
'properties' => {
|
66
|
+
'a_boolean' => {
|
67
|
+
'property' => true
|
68
|
+
},
|
69
|
+
'an_integer' => {
|
70
|
+
'property' => 1
|
71
|
+
},
|
72
|
+
'a_float' => {
|
73
|
+
'property' => 4.5
|
74
|
+
},
|
75
|
+
'a_string' => {
|
76
|
+
'property' => 'string'
|
77
|
+
},
|
78
|
+
'an_array' => {
|
79
|
+
'property' => [1, 2, 3]
|
80
|
+
},
|
81
|
+
'an_hash' => {
|
82
|
+
'property' => {
|
83
|
+
'a_key' => 'a_value'
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
expect(klass.as_json).to eq(payload_h)
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'should return a JSON string of the payload' do
|
93
|
+
s = '{"properties":{"a_boolean":{"property":true},"an_integer":{"property":1},"a_float":{"property":4.5},"a_string":{"property":"string"},"an_array":{"property":[1,2,3]},"an_hash":{"property":{"a_key":"a_value"}}}}'
|
94
|
+
expect(klass.to_json).to eq(s)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -57,7 +57,7 @@ RSpec.describe Schemas::MySchemaWithComplexTypes do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
let(:schema_fields) do
|
60
|
-
%w(test_id test_float test_int_array test_optional_int test_string_array some_integer_map some_record some_optional_record some_record_array some_record_map some_enum_array)
|
60
|
+
%w(test_id test_float test_int_array test_optional_int test_string_array some_integer_map some_record some_optional_record some_record_array some_record_map some_enum_array some_optional_enum some_enum_with_default)
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'should return the name of the schema and namespace' do
|
@@ -77,6 +77,7 @@ RSpec.describe Schemas::MySchemaWithComplexTypes do
|
|
77
77
|
'test_float' => 1.2,
|
78
78
|
'test_string_array' => %w(abc def),
|
79
79
|
'test_int_array' => [123, 456],
|
80
|
+
'some_optional_enum' => nil,
|
80
81
|
'test_optional_int' => 123,
|
81
82
|
'some_integer_map' => { 'int_1' => 1, 'int_2' => 2 },
|
82
83
|
'some_record' => { 'a_record_field' => 'field 1' },
|
@@ -89,14 +90,15 @@ RSpec.describe Schemas::MySchemaWithComplexTypes do
|
|
89
90
|
'record_1' => { 'a_record_field' => 'field 5' },
|
90
91
|
'record_2' => { 'a_record_field' => 'field 6' }
|
91
92
|
},
|
92
|
-
'some_enum_array' => %w(sym1 sym2)
|
93
|
+
'some_enum_array' => %w(sym1 sym2),
|
94
|
+
'some_enum_with_default' => 'sym6'
|
93
95
|
}
|
94
96
|
|
95
97
|
expect(klass.as_json).to eq(payload_h)
|
96
98
|
end
|
97
99
|
|
98
100
|
it 'should return a JSON string of the payload' do
|
99
|
-
s = '{"test_id":"test id","test_float":1.2,"test_string_array":["abc","def"],"test_int_array":[123,456],"test_optional_int":123,"some_integer_map":{"int_1":1,"int_2":2},"some_record":{"a_record_field":"field 1"},"some_optional_record":{"a_record_field":"field 2"},"some_record_array":[{"a_record_field":"field 3"},{"a_record_field":"field 4"}],"some_record_map":{"record_1":{"a_record_field":"field 5"},"record_2":{"a_record_field":"field 6"}},"some_enum_array":["sym1","sym2"]}'
|
101
|
+
s = '{"test_id":"test id","test_float":1.2,"test_string_array":["abc","def"],"test_int_array":[123,456],"test_optional_int":123,"some_integer_map":{"int_1":1,"int_2":2},"some_record":{"a_record_field":"field 1"},"some_optional_record":{"a_record_field":"field 2"},"some_record_array":[{"a_record_field":"field 3"},{"a_record_field":"field 4"}],"some_record_map":{"record_1":{"a_record_field":"field 5"},"record_2":{"a_record_field":"field 6"}},"some_enum_array":["sym1","sym2"],"some_optional_enum":null,"some_enum_with_default":"sym6"}'
|
100
102
|
expect(klass.to_json).to eq(s)
|
101
103
|
end
|
102
104
|
end
|
@@ -73,6 +73,32 @@ RSpec.describe Deimos::Generators::SchemaClassGenerator do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
context 'with a Consumers Schema with a circular reference' do
|
77
|
+
before(:each) do
|
78
|
+
Deimos.configure do
|
79
|
+
consumer do
|
80
|
+
class_name 'ConsumerTest::MyConsumer'
|
81
|
+
topic 'MyTopic'
|
82
|
+
schema 'MySchemaWithCircularReference'
|
83
|
+
namespace 'com.my-namespace'
|
84
|
+
key_config field: :a_string
|
85
|
+
end
|
86
|
+
end
|
87
|
+
described_class.start
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should generate the correct number of classes' do
|
91
|
+
expect(files.length).to eq(1)
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'should generate a schema class for my_schema_with_circular_reference' do
|
95
|
+
generated_path = files.select { |f| f =~ /my_schema_with_circular_reference/ }.first
|
96
|
+
expected_path = expected_files.select { |f| f =~ /my_schema_with_circular_reference/ }.first
|
97
|
+
|
98
|
+
expect(File.read(generated_path)).to eq(File.read(expected_path))
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
76
102
|
context 'with a Producers Schema and a Key' do
|
77
103
|
before(:each) do
|
78
104
|
Deimos.configure do
|
@@ -3,28 +3,6 @@
|
|
3
3
|
# This file is autogenerated by Deimos, Do NOT modify
|
4
4
|
module Schemas
|
5
5
|
### Secondary Schema Classes ###
|
6
|
-
# Autogenerated Schema for Enum at com.my-namespace.AnEnum
|
7
|
-
class AnEnum < Deimos::SchemaClass::Enum
|
8
|
-
# @return ['sym1', 'sym2']
|
9
|
-
attr_accessor :an_enum
|
10
|
-
|
11
|
-
# :nodoc:
|
12
|
-
def initialize(an_enum)
|
13
|
-
super
|
14
|
-
self.an_enum = an_enum
|
15
|
-
end
|
16
|
-
|
17
|
-
# @override
|
18
|
-
def symbols
|
19
|
-
%w(sym1 sym2)
|
20
|
-
end
|
21
|
-
|
22
|
-
# @override
|
23
|
-
def to_h
|
24
|
-
@an_enum
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
6
|
# Autogenerated Schema for Record at com.my-namespace.ARecord
|
29
7
|
class ARecord < Deimos::SchemaClass::Record
|
30
8
|
### Attribute Accessors ###
|
@@ -55,6 +33,28 @@ module Schemas
|
|
55
33
|
end
|
56
34
|
end
|
57
35
|
|
36
|
+
# Autogenerated Schema for Enum at com.my-namespace.AnEnum
|
37
|
+
class AnEnum < Deimos::SchemaClass::Enum
|
38
|
+
# @return ['sym1', 'sym2']
|
39
|
+
attr_accessor :an_enum
|
40
|
+
|
41
|
+
# :nodoc:
|
42
|
+
def initialize(an_enum)
|
43
|
+
super
|
44
|
+
self.an_enum = an_enum
|
45
|
+
end
|
46
|
+
|
47
|
+
# @override
|
48
|
+
def symbols
|
49
|
+
%w(sym1 sym2)
|
50
|
+
end
|
51
|
+
|
52
|
+
# @override
|
53
|
+
def to_h
|
54
|
+
@an_enum
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
58
|
### Primary Schema Class ###
|
59
59
|
# Autogenerated Schema for Record at com.my-namespace.Generated
|
60
60
|
class Generated < Deimos::SchemaClass::Record
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
4
|
+
module Schemas
|
5
|
+
### Secondary Schema Classes ###
|
6
|
+
# Autogenerated Schema for Record at com.my-namespace.Property
|
7
|
+
class Property < Deimos::SchemaClass::Record
|
8
|
+
### Attribute Accessors ###
|
9
|
+
# @param value [Boolean, Integer, Integer, Float, Float, String, Array<Property>, Hash<String, Property>]
|
10
|
+
attr_accessor :property
|
11
|
+
|
12
|
+
# @override
|
13
|
+
def initialize(property: nil)
|
14
|
+
super
|
15
|
+
self.property = property
|
16
|
+
end
|
17
|
+
|
18
|
+
# @override
|
19
|
+
def schema
|
20
|
+
'Property'
|
21
|
+
end
|
22
|
+
|
23
|
+
# @override
|
24
|
+
def namespace
|
25
|
+
'com.my-namespace'
|
26
|
+
end
|
27
|
+
|
28
|
+
# @override
|
29
|
+
def to_h
|
30
|
+
{
|
31
|
+
'property' => @property
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
### Primary Schema Class ###
|
37
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithCircularReference
|
38
|
+
class MySchemaWithCircularReference < Deimos::SchemaClass::Record
|
39
|
+
### Attribute Readers ###
|
40
|
+
# @return [Hash<String, Property>]
|
41
|
+
attr_reader :properties
|
42
|
+
|
43
|
+
### Attribute Writers ###
|
44
|
+
# @param values [Hash<String, Property>]
|
45
|
+
def properties=(values)
|
46
|
+
@properties = values.transform_values do |value|
|
47
|
+
Property.initialize_from_value(value)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# @override
|
52
|
+
def initialize(properties: {})
|
53
|
+
super
|
54
|
+
self.properties = properties
|
55
|
+
end
|
56
|
+
|
57
|
+
# @override
|
58
|
+
def schema
|
59
|
+
'MySchemaWithCircularReference'
|
60
|
+
end
|
61
|
+
|
62
|
+
# @override
|
63
|
+
def namespace
|
64
|
+
'com.my-namespace'
|
65
|
+
end
|
66
|
+
|
67
|
+
# @override
|
68
|
+
def to_h
|
69
|
+
{
|
70
|
+
'properties' => @properties.transform_values { |v| v&.to_h }
|
71
|
+
}
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -55,6 +55,50 @@ module Schemas
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
# Autogenerated Schema for Enum at com.my-namespace.AnotherEnum
|
59
|
+
class AnotherEnum < Deimos::SchemaClass::Enum
|
60
|
+
# @return ['sym3', 'sym4']
|
61
|
+
attr_accessor :another_enum
|
62
|
+
|
63
|
+
# :nodoc:
|
64
|
+
def initialize(another_enum)
|
65
|
+
super
|
66
|
+
self.another_enum = another_enum
|
67
|
+
end
|
68
|
+
|
69
|
+
# @override
|
70
|
+
def symbols
|
71
|
+
%w(sym3 sym4)
|
72
|
+
end
|
73
|
+
|
74
|
+
# @override
|
75
|
+
def to_h
|
76
|
+
@another_enum
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Autogenerated Schema for Enum at com.my-namespace.YetAnotherEnum
|
81
|
+
class YetAnotherEnum < Deimos::SchemaClass::Enum
|
82
|
+
# @return ['sym5', 'sym6']
|
83
|
+
attr_accessor :yet_another_enum
|
84
|
+
|
85
|
+
# :nodoc:
|
86
|
+
def initialize(yet_another_enum)
|
87
|
+
super
|
88
|
+
self.yet_another_enum = yet_another_enum
|
89
|
+
end
|
90
|
+
|
91
|
+
# @override
|
92
|
+
def symbols
|
93
|
+
%w(sym5 sym6)
|
94
|
+
end
|
95
|
+
|
96
|
+
# @override
|
97
|
+
def to_h
|
98
|
+
@yet_another_enum
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
58
102
|
### Primary Schema Class ###
|
59
103
|
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithComplexTypes
|
60
104
|
class MySchemaWithComplexTypes < Deimos::SchemaClass::Record
|
@@ -69,6 +113,10 @@ module Schemas
|
|
69
113
|
attr_reader :some_record_map
|
70
114
|
# @return [Array<AnEnum>]
|
71
115
|
attr_reader :some_enum_array
|
116
|
+
# @return [nil, AnotherEnum]
|
117
|
+
attr_reader :some_optional_enum
|
118
|
+
# @return [YetAnotherEnum]
|
119
|
+
attr_reader :some_enum_with_default
|
72
120
|
|
73
121
|
### Attribute Accessors ###
|
74
122
|
# @param value [String]
|
@@ -116,6 +164,16 @@ module Schemas
|
|
116
164
|
end
|
117
165
|
end
|
118
166
|
|
167
|
+
# @param value [nil, AnotherEnum]
|
168
|
+
def some_optional_enum=(value)
|
169
|
+
@some_optional_enum = AnotherEnum.initialize_from_value(value)
|
170
|
+
end
|
171
|
+
|
172
|
+
# @param value [YetAnotherEnum]
|
173
|
+
def some_enum_with_default=(value)
|
174
|
+
@some_enum_with_default = YetAnotherEnum.initialize_from_value(value)
|
175
|
+
end
|
176
|
+
|
119
177
|
# @override
|
120
178
|
def initialize(test_id: nil,
|
121
179
|
test_float: nil,
|
@@ -127,7 +185,9 @@ module Schemas
|
|
127
185
|
some_optional_record: nil,
|
128
186
|
some_record_array: nil,
|
129
187
|
some_record_map: nil,
|
130
|
-
some_enum_array: nil
|
188
|
+
some_enum_array: nil,
|
189
|
+
some_optional_enum: nil,
|
190
|
+
some_enum_with_default: "sym6")
|
131
191
|
super
|
132
192
|
self.test_id = test_id
|
133
193
|
self.test_float = test_float
|
@@ -140,6 +200,8 @@ module Schemas
|
|
140
200
|
self.some_record_array = some_record_array
|
141
201
|
self.some_record_map = some_record_map
|
142
202
|
self.some_enum_array = some_enum_array
|
203
|
+
self.some_optional_enum = some_optional_enum
|
204
|
+
self.some_enum_with_default = some_enum_with_default
|
143
205
|
end
|
144
206
|
|
145
207
|
# @override
|
@@ -165,7 +227,9 @@ module Schemas
|
|
165
227
|
'some_optional_record' => @some_optional_record&.to_h,
|
166
228
|
'some_record_array' => @some_record_array.map { |v| v&.to_h },
|
167
229
|
'some_record_map' => @some_record_map.transform_values { |v| v&.to_h },
|
168
|
-
'some_enum_array' => @some_enum_array.map { |v| v&.to_h }
|
230
|
+
'some_enum_array' => @some_enum_array.map { |v| v&.to_h },
|
231
|
+
'some_optional_enum' => @some_optional_enum&.to_h,
|
232
|
+
'some_enum_with_default' => @some_enum_with_default&.to_h
|
169
233
|
}
|
170
234
|
end
|
171
235
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"namespace": "com.my-namespace",
|
3
|
+
"name": "MySchemaWithCircularReference",
|
4
|
+
"type": "record",
|
5
|
+
"fields": [
|
6
|
+
{
|
7
|
+
"default": {},
|
8
|
+
"name": "properties",
|
9
|
+
"type": {
|
10
|
+
"type": "map",
|
11
|
+
"values": {
|
12
|
+
"fields": [
|
13
|
+
{
|
14
|
+
"name": "property",
|
15
|
+
"type": [
|
16
|
+
"boolean",
|
17
|
+
"int",
|
18
|
+
"long",
|
19
|
+
"float",
|
20
|
+
"double",
|
21
|
+
"string",
|
22
|
+
{
|
23
|
+
"items": "Property",
|
24
|
+
"type": "array"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"type": "map",
|
28
|
+
"values": "Property"
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
],
|
33
|
+
"name": "Property",
|
34
|
+
"type": "record"
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
]
|
39
|
+
}
|
@@ -90,6 +90,26 @@
|
|
90
90
|
"symbols": ["sym1", "sym2"]
|
91
91
|
}
|
92
92
|
}
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"name": "some_optional_enum",
|
96
|
+
"type": [
|
97
|
+
"null",
|
98
|
+
{
|
99
|
+
"type": "enum",
|
100
|
+
"name": "AnotherEnum",
|
101
|
+
"symbols": ["sym3", "sym4"]
|
102
|
+
}
|
103
|
+
]
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"name": "some_enum_with_default",
|
107
|
+
"default": "sym6",
|
108
|
+
"type": {
|
109
|
+
"type": "enum",
|
110
|
+
"name": "YetAnotherEnum",
|
111
|
+
"symbols": ["sym5", "sym6"]
|
112
|
+
}
|
93
113
|
}
|
94
114
|
]
|
95
115
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro_turf
|
@@ -463,6 +463,7 @@ files:
|
|
463
463
|
- spec/consumer_spec.rb
|
464
464
|
- spec/deimos_spec.rb
|
465
465
|
- spec/generators/active_record_generator_spec.rb
|
466
|
+
- spec/generators/schema_class/my_schema_with_circular_reference_spec.rb
|
466
467
|
- spec/generators/schema_class/my_schema_with_complex_types_spec.rb
|
467
468
|
- spec/generators/schema_class_generator_spec.rb
|
468
469
|
- spec/handlers/my_batch_consumer.rb
|
@@ -484,12 +485,14 @@ files:
|
|
484
485
|
- spec/schema_classes/my_nested_schema.rb
|
485
486
|
- spec/schema_classes/my_schema.rb
|
486
487
|
- spec/schema_classes/my_schema_key.rb
|
488
|
+
- spec/schema_classes/my_schema_with_circular_reference.rb
|
487
489
|
- spec/schema_classes/my_schema_with_complex_types.rb
|
488
490
|
- spec/schemas/com/my-namespace/Generated.avsc
|
489
491
|
- spec/schemas/com/my-namespace/MyNestedSchema.avsc
|
490
492
|
- spec/schemas/com/my-namespace/MySchema.avsc
|
491
493
|
- spec/schemas/com/my-namespace/MySchemaCompound_key.avsc
|
492
494
|
- spec/schemas/com/my-namespace/MySchemaWithBooleans.avsc
|
495
|
+
- spec/schemas/com/my-namespace/MySchemaWithCircularReference.avsc
|
493
496
|
- spec/schemas/com/my-namespace/MySchemaWithComplexTypes.avsc
|
494
497
|
- spec/schemas/com/my-namespace/MySchemaWithDateTimes.avsc
|
495
498
|
- spec/schemas/com/my-namespace/MySchemaWithId.avsc
|
@@ -554,6 +557,7 @@ test_files:
|
|
554
557
|
- spec/consumer_spec.rb
|
555
558
|
- spec/deimos_spec.rb
|
556
559
|
- spec/generators/active_record_generator_spec.rb
|
560
|
+
- spec/generators/schema_class/my_schema_with_circular_reference_spec.rb
|
557
561
|
- spec/generators/schema_class/my_schema_with_complex_types_spec.rb
|
558
562
|
- spec/generators/schema_class_generator_spec.rb
|
559
563
|
- spec/handlers/my_batch_consumer.rb
|
@@ -575,12 +579,14 @@ test_files:
|
|
575
579
|
- spec/schema_classes/my_nested_schema.rb
|
576
580
|
- spec/schema_classes/my_schema.rb
|
577
581
|
- spec/schema_classes/my_schema_key.rb
|
582
|
+
- spec/schema_classes/my_schema_with_circular_reference.rb
|
578
583
|
- spec/schema_classes/my_schema_with_complex_types.rb
|
579
584
|
- spec/schemas/com/my-namespace/Generated.avsc
|
580
585
|
- spec/schemas/com/my-namespace/MyNestedSchema.avsc
|
581
586
|
- spec/schemas/com/my-namespace/MySchema.avsc
|
582
587
|
- spec/schemas/com/my-namespace/MySchemaCompound_key.avsc
|
583
588
|
- spec/schemas/com/my-namespace/MySchemaWithBooleans.avsc
|
589
|
+
- spec/schemas/com/my-namespace/MySchemaWithCircularReference.avsc
|
584
590
|
- spec/schemas/com/my-namespace/MySchemaWithComplexTypes.avsc
|
585
591
|
- spec/schemas/com/my-namespace/MySchemaWithDateTimes.avsc
|
586
592
|
- spec/schemas/com/my-namespace/MySchemaWithId.avsc
|