avro-schema
avro-schema copied to clipboard
flatten({}) fails on a 'record' schema with all fields have default values
#!/usr/bin/tarantool
local avro = require('avro_schema')
local yaml = require('yaml')
local schema={
name='example',
type='record',
fields={
{name='f1', type='long', default=0},
{name='f2', type='long', default=0},
{name='f3', type='long', default=0},
}
}
local _, created = avro.create(schema)
local _, compiled = avro.compile(created)
local _, fl = compiled.flatten({})
print(yaml.encode(fl))
Expected:
--- [0, 0, 0]
...
Got:
--- Expecting MAP, encountered ARRAY
...
Still actual (Avro
3.0).