Skip to content

Commit

Permalink
Rename field from Items to ItemsMetadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Dec 12, 2024
1 parent e73190e commit da18c01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/debezium/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ type Field struct {
FieldName string `json:"field"`
DebeziumType SupportedDebeziumType `json:"name"`
Parameters map[string]any `json:"parameters"`
// [Items] is only populated if the literal type is an array.
Items Item `json:"items"`
// [ItemsMetadata] is only populated if the literal type is an array.
ItemsMetadata Item `json:"items"`
}

func (f Field) GetScaleAndPrecision() (int32, *int32, error) {
Expand Down Expand Up @@ -146,7 +146,7 @@ func (f Field) ToValueConverter() (converters.ValueConverter, error) {

switch f.Type {
case Array:
return converters.NewArray(f.Items.DebeziumType == JSON), nil
return converters.NewArray(f.ItemsMetadata.DebeziumType == JSON), nil
case Double, Float:
return converters.Float64{}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion lib/debezium/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestField_ParseValue(t *testing.T) {
}
{
// Array
field := Field{Type: Array, Items: Item{DebeziumType: JSON}}
field := Field{Type: Array, ItemsMetadata: Item{DebeziumType: JSON}}
value, err := field.ParseValue([]any{`{"foo": "bar", "foo": "bar"}`, `{"hello": "world"}`})
assert.NoError(t, err)
assert.Len(t, value.([]any), 2)
Expand Down

0 comments on commit da18c01

Please sign in to comment.