Closed DaanRademaker closed 2 years ago
Merging #49 (f3e10c0) into main (bb4b95a) will increase coverage by
0.17%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #49 +/- ##
==========================================
+ Coverage 89.77% 89.94% +0.17%
==========================================
Files 2 2
Lines 176 179 +3
==========================================
+ Hits 158 161 +3
Misses 18 18
Impacted Files | Coverage Δ | |
---|---|---|
src/pydantic_avro/base.py | 97.70% <100.00%> (+0.08%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
can you add some testing for this?
Hi, I was curious that why optional field namespace
was being encoded into final avro schema json representation. Because even in the Apache Avro specification it is written explicitly that namespace
field is optional so it may not even exist inside the final avro schema json representation. Only required fields that should exist are name
and fields
. So, I think it is a bad idea to have name
as a default value for namespace
if it is not given.
They also gave sample avro schema json representation where there is no namespace
field:
{
"type": "record",
"name": "LongList",
"aliases": ["LinkedLongs"], // old name for this
"fields" : [
{"name": "value", "type": "long"}, // each element has a long
{"name": "next", "type": ["null", "LongList"]} // optional next element
]
}
This pull request adds the possibility to add namespace parameter to avro schema generation.