-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RON incorrectly adds extra level of Base64 when roundtripping Bytes #436
Comments
This really is a tricky one! I think though that I now understand what is going on here. The problem is the ron in general is a format that does not support deserialising without any type information (i.e. anything that touches @torkleyy What are your thoughts on this? |
I think having special support built-in for bytes / base64 encoding can be an advantage, even if it means breaking some compatibility. I'm not sure if we can ease the transition somehow to not cause any breakage in practice. |
* Switch from base64 to rusty byte strings, deprecate base64 support * Add the Value::Bytes variant * Extend Value tests for Value::String and Value::Bytes * Include byte strings in the RON grammar * Fix ASCII escape decoding for strings and byte strings * Fix byte string error display for #462 test * Fix byte string error test * Add a CHANGELOG entry * Added a deprecation error test for v0.10 * Add tests for v0.9 optional base64 byte string support Co-authored-by: Sebastian Dröge <sebastian@centricular.com> * Add an example for using base64-encoded bytes with ron * Fix formatting in README * Remove outdated extension docs * Add tests for unescaped and raw byte strings * Fix fuzzer-found issue with serialising invalid UTF-8 byte strings * Fix fuzzer found issue with `br#` being parsed as the identifier `br` * Fix parsing of byte escapes in UTF-8 strings to produce proper Unicode characters * Fix fuzzer-found interaction with unwrap_variant_newtypes * Add support for strongly typed byte literals * Add missing Value serialising tests * Add test to show that #436 is solved with strongly typed base64 user-side types * Add more coverage tests --------- Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
This code (playground):
has the following output:
It fully survives the roundtrip with
serde_json
, but adds extra level of Base64 with RON.The text was updated successfully, but these errors were encountered: