UTF-8 Serializer - #983
UTF-8 Serializer#983maknapp wants to merge 4 commits into
Conversation
Not sure why the test failed... expected should be using |
The fix is either We experienced this issue in the past already. Is there something wrong with the line ending definition for the repo? |
If I remember correctly the BOM option had compatibility reasons. The BOM is clearly excluded in RFC, so I vote for not allowing uncompliant output. A related question might arise with line endings, which are also well defined as CR LF, not LF-only. Different output is up to users. |
Changes test classes that have a lot of serializer tests to test both old and new serializers with the same data.
f4510ca to
489a7b6
Compare
|



This is a mostly functional serializer with some parts completely untested. I did change a few tests because they seemed like mistakes to me.
I think deprecating in v6 is the way to go here. The public surface area of the current serializer methods is too large and won't allow for minor breaking changes to be made with the new serializer (like changing exception types). For example, I tried changing the existing
SerializeToStringmethods to use the newTryParsemethods, but manySerializeToStringmethods differ how they throw exceptions vs returningnull.Some of the
SerializeToStringmethods are copied directly into theTryParseor converter methods just to be 100% sure not to break anything with the old serializer. SomeTryParsemethods are different to test reducing allocations.Some tests are changed to test only the new
TryParsemethods instead of continuing to test the correspondingSerializeToStringmethods - this was just me being lazy for now. The latest commit is testing out how to test both serializers at the same time.Type mapping is simplified. The new serializer matches only by property name. A
CalendarPropertyConverteris expected to handle all VALUE types for its property.Activatoris not used at all, so this should avoid any issues mentioned in #977 too.Undefined properties use the default converter, which assumes all values are strings even if VALUE is defined. This is the same behavior as the old serializer.
Backslash encoding is applied only to TEXT value types. Most/all(?) other value types specifically say no other encoding (backslash) applies.
There is no encoding option. It currently writes without BOM by default, same as old serializer. Do we need an option to include BOM?
Todo
LineNumberto point directly to the errorTryParsemethods have good parameter names and will never throw exceptionsOnDeserializingandOnDeserializedevents are requiredSerializeAsyncPipeReaderandPipeWriter(might makeSerializeAsynceasier too)Benchmarks
Fixes #973, #978, #702, #937
Partial #908
Partial #977