You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apache-avro crate interacts with #[serde(flatten)] #219
Starting from version 0.18.0 of the apache-avro crate, serde JSON deserialization behaves unexpectedly even if the avro crate is not directly used. The mere presence of the avro crate as a dependency causes a failure in deserialization logic.
Steps to reproduce:
Create a new project with any version of serde.
Add the following test code (which should pass as expected):
Now add any version of apache-avro greater than 0.17.0 to Cargo.toml, e.g.: apache-avro = "0.18.0"
Re-run the test. The test will now fail with the following error:
Error: invalid type: map, expected f64 at line 5 column 3
Notes:
The error does not occur when apache-avro = "0.17.0" is used.
The issue only appears when using floating point numbers like 0.3 and 3.76. If the values are whole numbers (e.g., 1, 2), the deserialization works fine.
The avro crate is not used in the deserialization code – its presence as a dependency appears to alter serde behavior globally, which may indicate a side effect or conflicting serde deserializer implementation introduced in avro >= 0.18.0.
We are looking forward to this fix, as we recently came across this as well. We have an internal note tracking to update to the latest published version of the apache-avro crate. Hopefully it makes it into 0.20.0!
Do you have an estimation as to when the release will be made? The reason I ask is that since Git dependencies cannot be used when publishing crates, I am unable to publish to our internal crates registry for the package that uses apache_avro. So the options I have are to wait for 0.20.0 or internally fork this repo and release it as a crate to our internal crates registry as a stop-gap solution.
Just posting here to try and gauge timelines, which will help me choose which solution.
Activity
Kriskras99 commentedon Jul 1, 2025
Introduced in commit f92cf3f (#139)
martin-g commentedon Jul 1, 2025
I have the feeling the problem is f92cf3f#diff-c33d726f785a667adbb90c32d2698e4b3ba9d591658e7efff75fac39ccf29b08R57
Let me verify!
martin-g commentedon Jul 1, 2025
Yep! It fixes it!
martin-g commentedon Jul 1, 2025
I am going to file an issue for
bigdecimalcrate.I can't explain myself why
bigdecimal = { default-features = false, version = "0.4.8", features = ["std", "serde"] }works when there is no such feature at https://github.com/akubera/bigdecimal-rs/blob/v0.4.8/Cargo.toml#L48-L52Fixes #219: Use `serde` as a feature for bigdecimal decimal
Kriskras99 commentedon Jul 1, 2025
Optional dependencies automatically generate a feature (if they're not used in other features), see the Cargo reference.
Kriskras99 commentedon Jul 1, 2025
@bompandreean the issue is caused by the
arbitrary_precisionfeature that was enabled onserde_jsonthroughapache-avro.I can reproduce it with your test case and the following dependencies:
See issue serde-rs/json#1157
Fixes apache#219: Use `serde` as a feature for bigdecimal decimal (ap…
bompandreean commentedon Jul 1, 2025
Thank you all for the super speedy fix and the extra information 🚀✨
bompandreean commentedon Jul 1, 2025
when are you going to make a new release with the fix ?
martin-g commentedon Jul 1, 2025
We just released 0.19.0.
Maybe next month.
Please use it as a Git dependency for now.
bmitc commentedon Aug 11, 2025
We are looking forward to this fix, as we recently came across this as well. We have an internal note tracking to update to the latest published version of the
apache-avrocrate. Hopefully it makes it into0.20.0!martin-g commentedon Aug 11, 2025
It will be part of the next release!
bmitc commentedon Aug 12, 2025
Sounds great! Thank you!
bmitc commentedon Aug 14, 2025
Do you have an estimation as to when the release will be made? The reason I ask is that since Git dependencies cannot be used when publishing crates, I am unable to publish to our internal crates registry for the package that uses
apache_avro. So the options I have are to wait for0.20.0or internally fork this repo and release it as a crate to our internal crates registry as a stop-gap solution.Just posting here to try and gauge timelines, which will help me choose which solution.
martin-g commentedon Aug 15, 2025
https://lists.apache.org/thread/2ztzlx9165gg1c672mm3zpfxdbsc5b1m
I just started the vote!
martin-g commentedon Aug 25, 2025
0.20.0 has been released!
bmitc commentedon Aug 25, 2025
Awesome! Thank you for pushing this through. This will be a big help in our release process.
update apache-avro version and patch symbolic to fix conflicts